• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ operation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中operation的典型用法代码示例。如果您正苦于以下问题:C++ operation类的具体用法?C++ operation怎么用?C++ operation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了operation类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

typename basic_template<H,F,O,A>::operation::recv basic_template<H,F,O,A>::operation::recv::operator () (const aio::buffer& b, int f, callback_t cb, const arg_t& a, const aio::timeout& tm) const
{
get_buffer() = b;
get_flags() = f;
get_callback() = cb;
get_arg() = a;
get_timeout() = tm;
return *this;
}
开发者ID:yurial,项目名称:cross_aio,代码行数:9,代码来源:basic_operation_recv.hpp


示例2: calculate_fee

 asset fee_schedule::calculate_fee( const operation& op, const price& core_exchange_rate )const
 {
    //idump( (op)(core_exchange_rate) );
    fee_parameters params; params.set_which(op.which());
    auto itr = parameters.find(params);
    if( itr != parameters.end() ) params = *itr;
    auto base_value = op.visit( calc_fee_visitor( params ) );
    auto scaled = fc::uint128(base_value) * scale;
    scaled /= GRAPHENE_100_PERCENT;
    FC_ASSERT( scaled <= GRAPHENE_MAX_SHARE_SUPPLY );
    auto result = asset( scaled.to_uint64(), 0 ) * core_exchange_rate;
    FC_ASSERT( result.amount <= GRAPHENE_MAX_SHARE_SUPPLY );
    return result;
 }
开发者ID:sfinder,项目名称:graphene,代码行数:14,代码来源:fee_schedule.cpp


示例3: operation_get_required_authorities

void operation_get_required_authorities( const operation& op, 
                                         flat_set<account_id_type>& active,
                                         flat_set<account_id_type>& owner,
                                         vector<authority>&  other )
{
   op.visit( operation_get_required_auth( active, owner, other ) );
}
开发者ID:clar,项目名称:graphene,代码行数:7,代码来源:operations.cpp


示例4: uint64_t

operation_result database::apply_operation(transaction_evaluation_state& eval_state, const operation& op)
{ try {
   int i_which = op.which();
   uint64_t u_which = uint64_t( i_which );
   FC_ASSERT( i_which >= 0, "Negative operation tag in operation ${op}", ("op",op) );
   FC_ASSERT( u_which < _operation_evaluators.size(), "No registered evaluator for operation ${op}", ("op",op) );
   unique_ptr<op_evaluator>& eval = _operation_evaluators[ u_which ];
   FC_ASSERT( eval, "No registered evaluator for operation ${op}", ("op",op) );
   auto op_id = push_applied_operation( op );
   auto result = eval->evaluate( eval_state, op, true );
   set_applied_operation_result( op_id, result );
   return result;
} FC_CAPTURE_AND_RETHROW( (op) ) }
开发者ID:hanxueming126,项目名称:bitshares-core,代码行数:13,代码来源:db_block.cpp


示例5: uint64_t

operation_result database::apply_operation(transaction_evaluation_state& eval_state, const operation& op)
{ try {
   int i_which = op.which();
   uint64_t u_which = uint64_t( i_which );
   if( i_which < 0 )
      assert( "Negative operation tag" && false );
   if( u_which >= _operation_evaluators.size() )
      assert( "No registered evaluator for this operation" && false );
   unique_ptr<op_evaluator>& eval = _operation_evaluators[ u_which ];
   if( !eval )
      assert( "No registered evaluator for this operation" && false );
   auto op_id = push_applied_operation( op );
   auto result = eval->evaluate( eval_state, op, true );
   set_applied_operation_result( op_id, result );
   return result;
} FC_CAPTURE_AND_RETHROW( (op) ) }
开发者ID:pmconrad,项目名称:graphene,代码行数:16,代码来源:db_block.cpp


示例6: calculate_fee

   asset fee_schedule::calculate_fee( const operation& op, const price& core_exchange_rate )const
   {
      auto base_value = op.visit( calc_fee_visitor( *this, op ) );
      auto scaled = fc::uint128(base_value) * scale;
      scaled /= GRAPHENE_100_PERCENT;
      FC_ASSERT( scaled <= GRAPHENE_MAX_SHARE_SUPPLY );
      //idump( (base_value)(scaled)(core_exchange_rate) );
      auto result = asset( scaled.to_uint64(), asset_id_type(0) ) * core_exchange_rate;
      //FC_ASSERT( result * core_exchange_rate >= asset( scaled.to_uint64()) );

      while( result * core_exchange_rate < asset( scaled.to_uint64()) )
        result.amount++;

      FC_ASSERT( result.amount <= GRAPHENE_MAX_SHARE_SUPPLY );
      return result;
   }
开发者ID:hanxueming126,项目名称:bitshares-core,代码行数:16,代码来源:fee_schedule.cpp


示例7: set_fee

 asset fee_schedule::set_fee( operation& op, const price& core_exchange_rate )const
 {
    auto f = calculate_fee( op, core_exchange_rate );
    op.visit( set_fee_visitor( f ) );
    return f;
 }
开发者ID:sfinder,项目名称:graphene,代码行数:6,代码来源:fee_schedule.cpp


示例8: calc_fee_visitor

 calc_fee_visitor( const fee_schedule& p, const operation& op ):param(p),current_op(op.which()){}
开发者ID:hanxueming126,项目名称:bitshares-core,代码行数:1,代码来源:fee_schedule.cpp


示例9: operation_validate

void operation_validate( const operation& op )
{
   op.visit( operation_validator() );
}
开发者ID:clar,项目名称:graphene,代码行数:4,代码来源:operations.cpp


示例10: get_data

typename basic_template<H,F,O,A>::operation::recv::data_t& basic_template<H,F,O,A>::operation::recv::get_privdata() const
{
return get_data().u.recv;
}
开发者ID:yurial,项目名称:cross_aio,代码行数:4,代码来源:basic_operation_recv.hpp


示例11: operation

basic_template<H,F,O,A>::operation::recv::recv(operation op):
    operation( op )
{
get_data().m_interface = &get_data().m_fdata->m_interface->recv;
}
开发者ID:yurial,项目名称:cross_aio,代码行数:5,代码来源:basic_operation_recv.hpp



注:本文中的operation类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ operations类代码示例发布时间:2022-05-31
下一篇:
C++ openstudio类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap