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_PROTO_DOMAIN_HPP
7 #define IROHA_SHARED_MODEL_PROTO_DOMAIN_HPP
8 
11 #include "qry_responses.pb.h"
12 
13 namespace shared_model {
14  namespace proto {
15  class Domain final
16  : public TrivialProto<interface::Domain, iroha::protocol::Domain> {
17  public:
18  template <typename DomainType>
19  explicit Domain(DomainType &&domain)
20  : TrivialProto(std::forward<DomainType>(domain)) {}
21 
22  Domain(const Domain &o) : Domain(o.proto_) {}
23 
24  Domain(Domain &&o) noexcept : Domain(std::move(o.proto_)) {}
25 
26  const interface::types::DomainIdType &domainId() const override {
27  return proto_->domain_id();
28  }
29 
30  const interface::types::RoleIdType &defaultRole() const override {
31  return proto_->default_role();
32  }
33  };
34  } // namespace proto
35 } // namespace shared_model
36 
37 #endif // IROHA_SHARED_MODEL_PROTO_DOMAIN_HPP
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:53
Definition: peer.hpp:48
Domain(DomainType &&domain)
Definition: domain.hpp:19
const interface::types::DomainIdType & domainId() const override
Definition: domain.hpp:26
Definition: trivial_proto.hpp:19
Domain(const Domain &o)
Definition: domain.hpp:22
Definition: domain.hpp:15
Definition: command_executor.hpp:12
const interface::types::RoleIdType & defaultRole() const override
Definition: domain.hpp:30
detail::ReferenceHolder< iroha::protocol::Domain > proto_
Definition: trivial_proto.hpp:36
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:51
Domain(Domain &&o) noexcept
Definition: domain.hpp:24