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