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 RemovePeer;
27  class RemoveSignatory;
28  class RevokePermission;
29  class SetAccountDetail;
30  class SetQuorum;
31  class SubtractAssetQuantity;
32  class TransferAsset;
33  class CompareAndSetAccountDetail;
34 
39  class Command : public ModelPrimitive<Command> {
40  private:
42  template <typename... Value>
43  using wrap = boost::variant<const Value &...>;
44 
45  public:
48  AddPeer,
50  AppendRole,
54  CreateRole,
55  DetachRole,
60  SetQuorum,
63  RemovePeer,
65 
69  virtual const CommandVariantType &get() const = 0;
70 
71  // ------------------------| Primitive override |-------------------------
72 
73  std::string toString() const override;
74 
75  bool operator==(const ModelType &rhs) const override;
76  };
77 
78  } // namespace interface
79 } // namespace shared_model
80 
81 #endif // IROHA_SHARED_MODEL_COMMAND_HPP
Definition: compare_and_set_account_detail.hpp:21
Definition: add_signatory.hpp:19
Definition: set_quorum.hpp:18
wrap< AddAssetQuantity, AddPeer, AddSignatory, AppendRole, CreateAccount, CreateAsset, CreateDomain, CreateRole, DetachRole, GrantPermission, RemoveSignatory, RevokePermission, SetAccountDetail, SetQuorum, SubtractAssetQuantity, TransferAsset, RemovePeer, CompareAndSetAccountDetail > CommandVariantType
Type of variant, that handle concrete command.
Definition: command.hpp:64
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:44
Definition: remove_peer.hpp:20
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:40
Definition: grant_permission.hpp:19
Definition: set_account_detail.hpp:19
Definition: revoke_permission.hpp:19
Definition: model_primitive.hpp:22
Definition: command.hpp:39
Definition: add_asset_quantity.hpp:20
Definition: create_role.hpp:19
Definition: command_executor.hpp:12
Definition: add_peer.hpp:20