hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
proto_query.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_PROTO_QUERY_HPP
7 #define IROHA_SHARED_MODEL_PROTO_QUERY_HPP
8 
10 
11 #include "queries.pb.h"
12 
13 namespace shared_model {
14  namespace proto {
15 
16  class Query final : public interface::Query {
17  public:
19 
20  Query(const Query &o);
21  Query(Query &&o) noexcept;
22 
23  explicit Query(const TransportType &ref);
24  explicit Query(TransportType &&ref);
25 
26  ~Query() override;
27 
28  const Query::QueryVariantType &get() const override;
29 
30  const interface::types::AccountIdType &creatorAccountId() const override;
31 
32  interface::types::CounterType queryCounter() const override;
33 
34  const interface::types::BlobType &blob() const override;
35 
36  const interface::types::BlobType &payload() const override;
37 
38  // ------------------------| Signable override |-------------------------
39  interface::types::SignatureRangeType signatures() const override;
40 
41  bool addSignature(const crypto::Signed &signed_blob,
42  const crypto::PublicKey &public_key) override;
43 
44  const interface::types::HashType &hash() const override;
45 
46  interface::types::TimestampType createdTime() const override;
47 
48  const TransportType &getTransport() const;
49 
50  protected:
51  Query *clone() const override;
52 
53  private:
54  struct Impl;
55  std::unique_ptr<Impl> impl_;
56  };
57 
58  } // namespace proto
59 } // namespace shared_model
60 
61 #endif // IROHA_SHARED_MODEL_PROTO_QUERY_HPP
Definition: hash.hpp:18
Definition: blob.hpp:24
interface::types::CounterType queryCounter() const override
Definition: proto_query.cpp:101
Definition: query.hpp:34
const interface::types::HashType & hash() const override
Definition: proto_query.cpp:132
iroha::protocol::Query TransportType
Definition: proto_query.hpp:18
interface::types::TimestampType createdTime() const override
Definition: proto_query.cpp:136
const interface::types::BlobType & payload() const override
Definition: proto_query.cpp:109
Definition: peer.hpp:48
const Query::QueryVariantType & get() const override
Definition: proto_query.cpp:93
boost::any_range< interface::Signature, boost::forward_traversal_tag, const Signature & > SignatureRangeType
Type of signature range, which returns when signatures are invoked.
Definition: range_types.hpp:24
Query(const Query &o)
Definition: proto_query.cpp:81
interface::types::SignatureRangeType signatures() const override
Definition: proto_query.cpp:113
Definition: proto_query.hpp:16
const TransportType & getTransport() const
Definition: proto_query.cpp:140
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
const interface::types::AccountIdType & creatorAccountId() const override
Definition: proto_query.cpp:97
Definition: range_types.hpp:19
const char * PublicKey
Definition: iroha_conf_literals.cpp:33
const interface::types::BlobType & blob() const override
Definition: proto_query.cpp:105
bool addSignature(const crypto::Signed &signed_blob, const crypto::PublicKey &public_key) override
Definition: proto_query.cpp:117
uint64_t CounterType
Type of counter.
Definition: types.hpp:66
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
Query * clone() const override
Definition: proto_query.cpp:144
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:64