hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
block_query_response.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_BLOCK_QUERY_RESPONSE_HPP
7 #define IROHA_SHARED_MODEL_BLOCK_QUERY_RESPONSE_HPP
8 
10 
11 #include <boost/variant/variant_fwd.hpp>
12 
13 namespace shared_model {
14  namespace interface {
15 
16  class BlockResponse;
17  class BlockErrorResponse;
18 
24  class BlockQueryResponse : public ModelPrimitive<BlockQueryResponse> {
25  private:
27  template <typename... Value>
28  using w = boost::variant<const Value &...>;
29 
30  public:
32  using QueryResponseVariantType = w<BlockResponse, BlockErrorResponse>;
33 
37  virtual const QueryResponseVariantType &get() const = 0;
38 
39  // ------------------------| Primitive override |-------------------------
40 
41  std::string toString() const override;
42 
43  bool operator==(const ModelType &rhs) const override;
44  };
45  } // namespace interface
46 } // namespace shared_model
47 #endif // IROHA_SHARED_MODEL_BLOCK_QUERY_RESPONSE_HPP
Definition: block_query_response.hpp:24
std::string toString() const override
Definition: block_query_response.cpp:16
BlockQueryResponse ModelType
Definition: model_primitive.hpp:27
bool operator==(const ModelType &rhs) const override
Definition: block_query_response.cpp:20
Definition: model_primitive.hpp:22
Definition: command_executor.hpp:12
w< BlockResponse, BlockErrorResponse > QueryResponseVariantType
Type of container with all concrete query response.
Definition: block_query_response.hpp:32