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  class SetSettingValue;
35 
40  class Command : public ModelPrimitive<Command> {
41  private:
43  template <typename... Value>
44  using wrap = boost::variant<const Value &...>;
45 
46  public:
49  AddPeer,
51  AppendRole,
55  CreateRole,
56  DetachRole,
61  SetQuorum,
64  RemovePeer,
67 
71  virtual const CommandVariantType &get() const = 0;
72 
73  // ------------------------| Primitive override |-------------------------
74 
75  std::string toString() const override;
76 
77  bool operator==(const ModelType &rhs) const override;
78  };
79 
80  } // namespace interface
81 } // namespace shared_model
82 
83 #endif // IROHA_SHARED_MODEL_COMMAND_HPP
Definition: compare_and_set_account_detail.hpp:21
Definition: add_signatory.hpp:19
Definition: set_quorum.hpp:18
Definition: subtract_asset_quantity.hpp:20
Definition: set_setting_value.hpp:19
wrap< AddAssetQuantity, AddPeer, AddSignatory, AppendRole, CreateAccount, CreateAsset, CreateDomain, CreateRole, DetachRole, GrantPermission, RemoveSignatory, RevokePermission, SetAccountDetail, SetQuorum, SubtractAssetQuantity, TransferAsset, RemovePeer, CompareAndSetAccountDetail, SetSettingValue > CommandVariantType
Type of variant, that handle concrete command.
Definition: command.hpp:66
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:45
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:41
Definition: grant_permission.hpp:19
Definition: set_account_detail.hpp:19
Definition: revoke_permission.hpp:19
Definition: model_primitive.hpp:22
Definition: command.hpp:40
Definition: add_asset_quantity.hpp:20
Definition: create_role.hpp:19
Definition: command_executor.hpp:12
Definition: add_peer.hpp:20