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
17  : public TrivialProto<interface::Asset, iroha::protocol::Asset> {
18  public:
19  template <typename AssetType>
20  explicit Asset(AssetType &&account)
21  : TrivialProto(std::forward<AssetType>(account)) {}
22 
23  Asset(const Asset &o) : Asset(o.proto_) {}
24 
25  Asset(Asset &&o) noexcept : Asset(std::move(o.proto_)) {}
26 
27  const interface::types::AssetIdType &assetId() const override {
28  return proto_->asset_id();
29  }
30 
31  const interface::types::DomainIdType &domainId() const override {
32  return proto_->domain_id();
33  }
34 
36  return proto_->precision();
37  }
38  };
39  } // namespace proto
40 } // namespace shared_model
41 
42 #endif // IROHA_SHARED_MODEL_PROTO_ASSET_HPP
Asset(AssetType &&account)
Definition: asset.hpp:20
Asset(Asset &&o) noexcept
Definition: asset.hpp:25
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:53
Definition: peer.hpp:48
Asset(const Asset &o)
Definition: asset.hpp:23
const interface::types::AssetIdType & assetId() const override
Definition: asset.hpp:27
Definition: asset.hpp:16
interface::types::PrecisionType precision() const override
Definition: asset.hpp:35
const interface::types::DomainIdType & domainId() const override
Definition: asset.hpp:31
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:41
Definition: trivial_proto.hpp:19
Definition: command_executor.hpp:12
detail::ReferenceHolder< iroha::protocol::Asset > proto_
Definition: trivial_proto.hpp:36
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55