本文整理汇总了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;未经允许,请勿转载。 |
请发表评论