Scorum
operation_util.hpp
Go to the documentation of this file.
1 
2 #pragma once
3 
5 
6 #include <fc/variant.hpp>
7 
8 #include <boost/container/flat_set.hpp>
9 
10 #include <string>
11 #include <vector>
12 
13 //
14 // Place DECLARE_OPERATION_TYPE in a .hpp file to declare
15 // functions related to your operation type
16 //
17 #define DECLARE_OPERATION_TYPE(OperationType) \
18  DECLARE_OPERATION_SERIALIZATOR(OperationType) \
19  \
20  namespace scorum { \
21  namespace protocol { \
22  \
23  void operation_validate(const OperationType& o); \
24  void operation_get_required_authorities(const OperationType& op, \
25  flat_set<account_name_type>& active, \
26  flat_set<account_name_type>& owner, \
27  flat_set<account_name_type>& posting, \
28  std::vector<authority>& other); \
29  } \
30  } /* scorum::protocol */
31 
32 #define DECLARE_OPERATION_SERIALIZATOR(OperationType) \
33  namespace fc { \
34  \
35  void to_variant(const OperationType&, fc::variant&); \
36  void from_variant(const fc::variant&, OperationType&); \
37  \
38  } /* fc */