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 TrivialProto<interface::AccountAsset,
18  iroha::protocol::AccountAsset> {
19  public:
20  template <typename AccountAssetType>
21  explicit AccountAsset(AccountAssetType &&accountAssetType)
22  : TrivialProto(std::forward<AccountAssetType>(accountAssetType)) {}
23 
25 
26  AccountAsset(AccountAsset &&o) noexcept
27  : AccountAsset(std::move(o.proto_)) {}
28 
29  const interface::types::AccountIdType &accountId() const override {
30  return proto_->account_id();
31  }
32 
33  const interface::types::AssetIdType &assetId() const override {
34  return proto_->asset_id();
35  }
36 
37  const interface::Amount &balance() const override {
38  return balance_;
39  }
40 
41  private:
42  const interface::Amount balance_{proto_->balance()};
43  };
44  } // namespace proto
45 } // namespace shared_model
46 
47 #endif // IROHA_PROTO_ACCOUNT_ASSET_HPP
Definition: account_asset.hpp:16
const interface::Amount & balance() const override
Definition: account_asset.hpp:37
const interface::types::AssetIdType & assetId() const override
Definition: account_asset.hpp:33
Definition: amount.hpp:19
Definition: peer.hpp:48
AccountAsset(const AccountAsset &o)
Definition: account_asset.hpp:24
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
const interface::types::AccountIdType & accountId() const override
Definition: account_asset.hpp:29
AccountAsset(AccountAsset &&o) noexcept
Definition: account_asset.hpp:26
Definition: trivial_proto.hpp:19
Definition: command_executor.hpp:12
detail::ReferenceHolder< iroha::protocol::AccountAsset > proto_
Definition: trivial_proto.hpp:36
AccountAsset(AccountAssetType &&accountAssetType)
Definition: account_asset.hpp:21
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55