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 
34  class Query : public Signable<Query> {
35  private:
37  template <typename... Value>
38  using wrap = boost::variant<const Value &...>;
39 
40  public:
42  using QueryVariantType = wrap<GetAccount,
49  GetRoles,
54 
58  virtual const QueryVariantType &get() const = 0;
59 
63  virtual const types::AccountIdType &creatorAccountId() const = 0;
64 
70  virtual types::CounterType queryCounter() const = 0;
71 
72  // ------------------------| Primitive override |-------------------------
73 
74  std::string toString() const override;
75 
76  bool operator==(const ModelType &rhs) const override;
77  };
78  } // namespace interface
79 } // namespace shared_model
80 
81 #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:34
Definition: get_transactions.hpp:14
Definition: signable.hpp:35
Definition: get_account_asset_transactions.hpp:21
std::string toString() const override
Definition: query.cpp:36
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_account_detail.hpp:29
Definition: get_account.hpp:14
Definition: get_block.hpp:14
uint64_t CounterType
Type of counter.
Definition: types.hpp:66
Definition: get_role_permissions.hpp:18
wrap< GetAccount, GetSignatories, GetAccountTransactions, GetAccountAssetTransactions, GetTransactions, GetAccountAssets, GetAccountDetail, GetRoles, GetRolePermissions, GetAssetInfo, GetPendingTransactions, GetBlock > QueryVariantType
Type of variant, that handle concrete query.
Definition: query.hpp:53
Definition: command_executor.hpp:12
bool operator==(const ModelType &rhs) const override
Definition: query.cpp:46
Definition: get_account_assets.hpp:20