hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
noncopyable_model_primitive.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_NONCOPYABLE_MODEL_PRIMITIVE_HPP
7 #define IROHA_NONCOPYABLE_MODEL_PRIMITIVE_HPP
8 
9 #include <ciso646>
10 
11 #include "utils/string_builder.hpp"
12 
13 namespace shared_model {
14  namespace interface {
19  template <typename Model>
21  public:
22  using ModelType = Model;
23 
24  NonCopyableModelPrimitive() = default;
25 
28  delete;
29 
31  default;
32 
37  virtual std::string toString() const {
39  .init("NonCopyablePrimitive")
40  .append("address", std::to_string(reinterpret_cast<uint64_t>(this)))
41  .finalize();
42  }
43 
44  virtual bool operator==(const ModelType &rhs) const = 0;
45 
46  virtual bool operator!=(const ModelType &rhs) const {
47  return not(*this == rhs);
48  }
49 
50  virtual ~NonCopyableModelPrimitive() = default;
51  };
52  } // namespace interface
53 } // namespace shared_model
54 #endif // IROHA_NONCOPYABLE_MODEL_PRIMITIVE_HPP
virtual bool operator==(const ModelType &rhs) const =0
virtual bool operator!=(const ModelType &rhs) const
Definition: noncopyable_model_primitive.hpp:46
std::string to_string(const Collection &collection, Lambda transform)
Definition: logger.hpp:132
virtual std::string toString() const
Definition: noncopyable_model_primitive.hpp:37
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
std::string finalize()
Definition: string_builder.cpp:52
Definition: peer.hpp:48
Definition: string_builder.hpp:16
PrettyStringBuilder & append(const std::string &name, const std::string &value)
Definition: string_builder.cpp:36
Definition: noncopyable_model_primitive.hpp:20
Definition: add_asset_quantity.hpp:20
Definition: command_executor.hpp:12
NonCopyableModelPrimitive & operator=(const NonCopyableModelPrimitive &)=delete