hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
query.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_QUERY_HPP
7 #define IROHA_SHARED_MODEL_QUERY_HPP
8 
9 #include <boost/variant/variant_fwd.hpp>
12 
13 namespace shared_model {
14  namespace interface {
15 
16  class GetAccount;
17  class GetBlock;
18  class GetSignatories;
19  class GetAccountTransactions;
20  class GetAccountAssetTransactions;
21  class GetTransactions;
22  class GetAccountAssets;
23  class GetAccountDetail;
24  class GetRoles;
25  class GetRolePermissions;
26  class GetAssetInfo;
27  class GetPendingTransactions;
28  class GetPeers;
29 
35  class Query : public Signable<Query> {
36  private:
38  template <typename... Value>
39  using wrap = boost::variant<const Value &...>;
40 
41  public:
43  using QueryVariantType = wrap<GetAccount,
50  GetRoles,
54  GetBlock,
56 
60  virtual const QueryVariantType &get() const = 0;
61 
65  virtual const types::AccountIdType &creatorAccountId() const = 0;
66 
72  virtual types::CounterType queryCounter() const = 0;
73 
74  // ------------------------| Primitive override |-------------------------
75 
76  std::string toString() const override;
77 
78  bool operator==(const ModelType &rhs) const override;
79  };
80  } // namespace interface
81 } // namespace shared_model
82 
83 #endif // IROHA_SHARED_MODEL_QUERY_HPP
Definition: get_pending_transactions.hpp:21
virtual const types::AccountIdType & creatorAccountId() const =0
Definition: get_asset_info.hpp:17
Definition: query.hpp:35
Definition: get_transactions.hpp:14
Definition: signable.hpp:35
Definition: get_account_asset_transactions.hpp:21
std::string toString() const override
Definition: query.cpp:37
Definition: get_signatories.hpp:18
Definition: get_account_transactions.hpp:21
virtual types::CounterType queryCounter() const =0
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
Definition: get_roles.hpp:17
Definition: get_peers.hpp:17
Definition: get_account_detail.hpp:29
Definition: get_account.hpp:14
wrap< GetAccount, GetSignatories, GetAccountTransactions, GetAccountAssetTransactions, GetTransactions, GetAccountAssets, GetAccountDetail, GetRoles, GetRolePermissions, GetAssetInfo, GetPendingTransactions, GetBlock, GetPeers > QueryVariantType
Type of variant, that handle concrete query.
Definition: query.hpp:55
Definition: get_block.hpp:14
uint64_t CounterType
Type of counter.
Definition: types.hpp:66
Definition: get_role_permissions.hpp:18
Definition: command_executor.hpp:12
bool operator==(const ModelType &rhs) const override
Definition: query.cpp:47
Definition: get_account_assets.hpp:20