hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
asset.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_PROTO_ASSET_HPP
7 #define IROHA_SHARED_MODEL_PROTO_ASSET_HPP
8 
12 #include "qry_responses.pb.h"
13 
14 namespace shared_model {
15  namespace proto {
16  class Asset final : public CopyableProto<interface::Asset,
17  iroha::protocol::Asset,
18  Asset> {
19  public:
20  template <typename AssetType>
21  explicit Asset(AssetType &&account)
22  : CopyableProto(std::forward<AssetType>(account)) {}
23 
24  Asset(const Asset &o) : Asset(o.proto_) {}
25 
26  Asset(Asset &&o) noexcept : Asset(std::move(o.proto_)) {}
27 
28  const interface::types::AssetIdType &assetId() const override {
29  return proto_->asset_id();
30  }
31 
32  const interface::types::DomainIdType &domainId() const override {
33  return proto_->domain_id();
34  }
35 
37  return proto_->precision();
38  }
39  };
40  } // namespace proto
41 } // namespace shared_model
42 
43 #endif // IROHA_SHARED_MODEL_PROTO_ASSET_HPP
Asset(AssetType &&account)
Definition: asset.hpp:21
detail::ReferenceHolder< iroha::protocol::Asset > proto_
Definition: trivial_proto.hpp:65
Asset(Asset &&o) noexcept
Definition: asset.hpp:26
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:51
Definition: peer.hpp:48
Asset(const Asset &o)
Definition: asset.hpp:24
const interface::types::AssetIdType & assetId() const override
Definition: asset.hpp:28
Definition: asset.hpp:16
interface::types::PrecisionType precision() const override
Definition: asset.hpp:36
const interface::types::DomainIdType & domainId() const override
Definition: asset.hpp:32
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:39
Definition: command_executor.hpp:12
Definition: trivial_proto.hpp:45
std::string AssetIdType
Type of asset id.
Definition: types.hpp:53