hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
abstract_tx_response.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ABSTRACT_TX_RESPONSE_HPP
7 #define IROHA_ABSTRACT_TX_RESPONSE_HPP
8 
10 #include "utils/string_builder.hpp"
11 
12 namespace shared_model {
13  namespace interface {
18  template <typename Model>
19  class AbstractTxResponse : public ModelPrimitive<Model> {
20  private:
24  virtual std::string className() const = 0;
25 
26  public:
27  // ------------------------| Primitive override |-------------------------
28 
29  std::string toString() const override {
30  return detail::PrettyStringBuilder().init(className()).finalize();
31  }
32 
33  bool operator==(const Model &rhs) const override {
34  return true;
35  }
36  };
37  } // namespace interface
38 } // namespace shared_model
39 
40 #endif // IROHA_ABSTRACT_TX_RESPONSE_HPP
std::string toString() const override
Definition: abstract_tx_response.hpp:29
Definition: abstract_tx_response.hpp:19
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
std::string finalize()
Definition: string_builder.cpp:52
Definition: string_builder.hpp:16
bool operator==(const Model &rhs) const override
Definition: abstract_tx_response.hpp:33
Definition: model_primitive.hpp:23
Definition: command_executor.hpp:12