hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
domain.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_DOMAIN_HPP
7 #define IROHA_SHARED_MODEL_DOMAIN_HPP
8 
11 #include "utils/string_builder.hpp"
12 
13 namespace shared_model {
14  namespace interface {
15 
19  class Domain : public ModelPrimitive<Domain> {
20  public:
24  virtual const types::DomainIdType &domainId() const = 0;
25 
29  virtual const types::RoleIdType &defaultRole() const = 0;
34  std::string toString() const override {
36  .init("Domain")
37  .append("domainId", domainId())
38  .append("defaultRole", defaultRole())
39  .finalize();
40  }
41 
47  bool operator==(const ModelType &rhs) const override {
48  return domainId() == rhs.domainId()
49  and defaultRole() == rhs.defaultRole();
50  }
51  };
52  } // namespace interface
53 } // namespace shared_model
54 
55 #endif // IROHA_SHARED_MODEL_DOMAIN_HPP
PrettyStringBuilder & init(const std::string &name)
Definition: string_builder.cpp:18
bool operator==(const ModelType &rhs) const override
Definition: domain.hpp:47
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:53
Definition: domain.hpp:19
std::string finalize()
Definition: string_builder.cpp:52
Definition: string_builder.hpp:16
virtual const types::RoleIdType & defaultRole() const =0
PrettyStringBuilder & append(const std::string &name, const std::string &value)
Definition: string_builder.cpp:36
virtual const types::DomainIdType & domainId() const =0
Definition: model_primitive.hpp:23
Definition: command_executor.hpp:12
std::string toString() const override
Definition: domain.hpp:34
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:51