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