CatapultServer  v0.5.0.1 (Elephant)
catapult::state::AccountBalances Class Reference

Container holding information about account. More...

Collaboration diagram for catapult::state::AccountBalances:

Public Member Functions

 AccountBalances ()
 Creates an empty account balances. More...
 
 AccountBalances (const AccountBalances &accountBalances)
 Copy constructor that makes a deep copy of accountBalances. More...
 
 AccountBalances (AccountBalances &&accountBalances)
 Move constructor that move constructs an account balances from accountBalances. More...
 
AccountBalancesoperator= (const AccountBalances &accountBalances)
 Assignment operator that makes a deep copy of accountBalances. More...
 
AccountBalancesoperator= (AccountBalances &&accountBalances)
 Move assignment operator that assigns accountBalances. More...
 
size_t size () const
 Returns the number of mosaics owned. More...
 
auto begin () const
 Returns a const iterator to the first element of the underlying set. More...
 
auto end () const
 Returns a const iterator to the element following the last element of the underlying set. More...
 
MosaicId optimizedMosaicId () const
 Gets the optimized mosaic id. More...
 
Amount get (MosaicId mosaicId) const
 Returns amount of funds of a given mosaic (mosaicId). More...
 
AccountBalancescredit (MosaicId mosaicId, Amount amount)
 Adds amount funds to a given mosaic (mosaicId). More...
 
AccountBalancesdebit (MosaicId mosaicId, Amount amount)
 Subtracts amount funds from a given mosaic (mosaicId). More...
 
void optimize (MosaicId id)
 Optimizes access of the mosaic with id. More...
 

Private Attributes

CompactMosaicMap m_balances
 
MosaicId m_optimizedMosaicId
 

Detailed Description

Container holding information about account.

Constructor & Destructor Documentation

◆ AccountBalances() [1/3]

catapult::state::AccountBalances::AccountBalances ( )
default

Creates an empty account balances.

◆ AccountBalances() [2/3]

catapult::state::AccountBalances::AccountBalances ( const AccountBalances accountBalances)

Copy constructor that makes a deep copy of accountBalances.

◆ AccountBalances() [3/3]

catapult::state::AccountBalances::AccountBalances ( AccountBalances &&  accountBalances)
default

Move constructor that move constructs an account balances from accountBalances.

Member Function Documentation

◆ begin()

auto catapult::state::AccountBalances::begin ( ) const
inline

Returns a const iterator to the first element of the underlying set.

Here is the call graph for this function:

◆ credit()

AccountBalances & catapult::state::AccountBalances::credit ( MosaicId  mosaicId,
Amount  amount 
)

Adds amount funds to a given mosaic (mosaicId).

Here is the call graph for this function:

◆ debit()

AccountBalances & catapult::state::AccountBalances::debit ( MosaicId  mosaicId,
Amount  amount 
)

Subtracts amount funds from a given mosaic (mosaicId).

Here is the call graph for this function:

◆ end()

auto catapult::state::AccountBalances::end ( ) const
inline

Returns a const iterator to the element following the last element of the underlying set.

Here is the call graph for this function:

◆ get()

Amount catapult::state::AccountBalances::get ( MosaicId  mosaicId) const

Returns amount of funds of a given mosaic (mosaicId).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

AccountBalances & catapult::state::AccountBalances::operator= ( AccountBalances &&  accountBalances)
default

Move assignment operator that assigns accountBalances.

◆ operator=() [2/2]

AccountBalances & catapult::state::AccountBalances::operator= ( const AccountBalances accountBalances)

Assignment operator that makes a deep copy of accountBalances.

Here is the call graph for this function:

◆ optimize()

void catapult::state::AccountBalances::optimize ( MosaicId  id)

Optimizes access of the mosaic with id.

Here is the call graph for this function:

◆ optimizedMosaicId()

MosaicId catapult::state::AccountBalances::optimizedMosaicId ( ) const

Gets the optimized mosaic id.

Here is the caller graph for this function:

◆ size()

size_t catapult::state::AccountBalances::size ( ) const
inline

Returns the number of mosaics owned.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_balances

CompactMosaicMap catapult::state::AccountBalances::m_balances
private

◆ m_optimizedMosaicId

MosaicId catapult::state::AccountBalances::m_optimizedMosaicId
private

The documentation for this class was generated from the following files: