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 
11 #include "utils/string_builder.hpp"
12 
13 namespace shared_model {
14  namespace interface {
19  template <typename Model>
20  class AbstractTxResponse : public ModelPrimitive<Model> {
21  private:
25  virtual std::string className() const = 0;
26 
27  public:
28  // ------------------------| Primitive override |-------------------------
29 
30  std::string toString() const override {
31  return detail::PrettyStringBuilder().init(className()).finalize();
32  }
33 
34  bool operator==(const Model &rhs) const override {
35  return true;
36  }
37  };
38  } // namespace interface
39 } // namespace shared_model
40 
41 #endif // IROHA_ABSTRACT_TX_RESPONSE_HPP
std::string toString() const override
Definition: abstract_tx_response.hpp:30
Definition: abstract_tx_response.hpp:20
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
std::string finalize()
Definition: string_builder.cpp:44
Definition: string_builder.hpp:18
bool operator==(const Model &rhs) const override
Definition: abstract_tx_response.hpp:34
Definition: model_primitive.hpp:22
Definition: command_executor.hpp:12