-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathoperations.cpp
37 lines (27 loc) · 1011 Bytes
/
operations.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <steemit/protocol/operations.hpp>
#include <steemit/protocol/operation_util_impl.hpp>
namespace steemit { namespace protocol {
struct is_market_op_visitor {
typedef bool result_type;
template<typename T>
bool operator()( T&& v )const { return false; }
bool operator()( const limit_order_create_operation& )const { return true; }
bool operator()( const limit_order_cancel_operation& )const { return true; }
bool operator()( const transfer_operation& )const { return true; }
bool operator()( const transfer_to_vesting_operation& )const { return true; }
};
bool is_market_operation( const operation& op ) {
return op.visit( is_market_op_visitor() );
}
struct is_vop_visitor
{
typedef bool result_type;
template< typename T >
bool operator()( const T& v )const { return v.is_virtual(); }
};
bool is_virtual_operation( const operation& op )
{
return op.visit( is_vop_visitor() );
}
} } // steemit::protocol
DEFINE_OPERATION_TYPE( steemit::protocol::operation )