hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
command.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_COMMAND_HPP
7 #define IROHA_SHARED_MODEL_COMMAND_HPP
8 
10 
11 #include <boost/variant/variant_fwd.hpp>
12 
13 namespace shared_model {
14  namespace interface {
15 
16  class AddAssetQuantity;
17  class AddPeer;
18  class AddSignatory;
19  class AppendRole;
20  class CreateAccount;
21  class CreateAsset;
22  class CreateDomain;
23  class CreateRole;
24  class DetachRole;
25  class GrantPermission;
26  class RemoveSignatory;
27  class RevokePermission;
28  class SetAccountDetail;
29  class SetQuorum;
30  class SubtractAssetQuantity;
31  class TransferAsset;
32 
37  class Command : public NonCopyableModelPrimitive<Command> {
38  private:
40  template <typename... Value>
41  using wrap = boost::variant<const Value &...>;
42 
43  public:
46  AddPeer,
48  AppendRole,
52  CreateRole,
53  DetachRole,
58  SetQuorum,
61 
65  virtual const CommandVariantType &get() const = 0;
66 
67  // ------------------------| Primitive override |-------------------------
68 
69  std::string toString() const override;
70 
71  bool operator==(const ModelType &rhs) const override;
72  };
73 
74  } // namespace interface
75 } // namespace shared_model
76 
77 #endif // IROHA_SHARED_MODEL_COMMAND_HPP
Definition: add_signatory.hpp:19
Definition: set_quorum.hpp:18
Definition: subtract_asset_quantity.hpp:20
Definition: detach_role.hpp:19
Definition: remove_signatory.hpp:18
Definition: create_asset.hpp:18
bool operator==(const ModelType &rhs) const override
Definition: command.cpp:43
Definition: append_role.hpp:19
Definition: transfer_asset.hpp:19
Definition: create_domain.hpp:18
Definition: create_account.hpp:19
std::string toString() const override
Definition: command.cpp:39
Definition: grant_permission.hpp:19
Definition: set_account_detail.hpp:19
Definition: revoke_permission.hpp:19
Definition: noncopyable_model_primitive.hpp:20
Definition: command.hpp:37
Definition: add_asset_quantity.hpp:20
Definition: create_role.hpp:19
Definition: command_executor.hpp:12
wrap< AddAssetQuantity, AddPeer, AddSignatory, AppendRole, CreateAccount, CreateAsset, CreateDomain, CreateRole, DetachRole, GrantPermission, RemoveSignatory, RevokePermission, SetAccountDetail, SetQuorum, SubtractAssetQuantity, TransferAsset > CommandVariantType
Type of variant, that handle concrete command.
Definition: command.hpp:60
Definition: add_peer.hpp:20