Scorum
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
scorum::protocol::asset Struct Reference

#include <asset.hpp>

Public Member Functions

 asset ()
 
 asset (share_type a, asset_symbol_type id)
 
asset_symbol_type symbol () const
 
double to_real () const
 
uint8_t decimals () const
 
std::string symbol_name () const
 
int64_t precision () const
 
std::string to_string () const
 
template<typename T >
assetoperator+= (const T &o_amount)
 
assetoperator+= (const asset &o)
 
template<typename T >
assetoperator-= (const T &o_amount)
 
assetoperator-= (const asset &o)
 
asset operator- () const
 
template<typename T >
assetoperator*= (const T &o_amount)
 
template<typename T >
assetoperator/= (const T &o_amount)
 
template<typename FractionalNumerator , typename FractionalDenominator >
assetoperator*= (const utils::fraction< FractionalNumerator, FractionalDenominator > &fraction)
 
assetoperator*= (const odds &k)
 

Static Public Member Functions

static asset maximum (asset_symbol_type id)
 
static asset min (asset_symbol_type id)
 
static asset from_string (const std::string &from)
 

Public Attributes

share_type amount
 

Friends

struct fc::reflector< asset >
 
bool operator== (const asset &a, const asset &b)
 
bool operator< (const asset &a, const asset &b)
 
bool operator<= (const asset &a, const asset &b)
 
bool operator!= (const asset &a, const asset &b)
 
bool operator> (const asset &a, const asset &b)
 
bool operator>= (const asset &a, const asset &b)
 
template<typename T >
asset operator+ (const asset &a, const T &b_amount)
 
asset operator+ (const asset &a, const asset &b)
 
template<typename T >
asset operator- (const asset &a, const T &b_amount)
 
asset operator- (const asset &a, const asset &b)
 
template<typename T >
asset operator* (const asset &a, const T &b_amount)
 
template<typename FractionalNumerator , typename FractionalDenominator >
asset operator* (const asset &a, const utils::fraction< FractionalNumerator, FractionalDenominator > &fraction)
 
asset operator* (const asset &a, const odds &k)
 
template<typename T >
asset operator/ (const asset &a, const T &b_amount)
 
asset operator% (const asset &a, const asset &b)
 

Detailed Description

Definition at line 15 of file asset.hpp.

Constructor & Destructor Documentation

◆ asset() [1/2]

scorum::protocol::asset::asset ( )
inline

Definition at line 17 of file asset.hpp.

◆ asset() [2/2]

scorum::protocol::asset::asset ( share_type  a,
asset_symbol_type  id 
)
inline

Definition at line 24 of file asset.hpp.

Member Function Documentation

◆ decimals()

uint8_t scorum::protocol::asset::decimals ( ) const

Definition at line 33 of file asset.cpp.

◆ from_string()

asset scorum::protocol::asset::from_string ( const std::string &  from)
static

Definition at line 85 of file asset.cpp.

◆ maximum()

static asset scorum::protocol::asset::maximum ( asset_symbol_type  id)
inlinestatic

Definition at line 37 of file asset.hpp.

◆ min()

static asset scorum::protocol::asset::min ( asset_symbol_type  id)
inlinestatic

Definition at line 41 of file asset.hpp.

◆ operator*=() [1/3]

asset& scorum::protocol::asset::operator*= ( const odds k)
inline

Definition at line 98 of file asset.hpp.

◆ operator*=() [2/3]

template<typename T >
asset& scorum::protocol::asset::operator*= ( const T &  o_amount)
inline

Definition at line 82 of file asset.hpp.

◆ operator*=() [3/3]

template<typename FractionalNumerator , typename FractionalDenominator >
asset& scorum::protocol::asset::operator*= ( const utils::fraction< FractionalNumerator, FractionalDenominator > &  fraction)
inline

Definition at line 93 of file asset.hpp.

◆ operator+=() [1/2]

asset& scorum::protocol::asset::operator+= ( const asset o)
inline

Definition at line 63 of file asset.hpp.

◆ operator+=() [2/2]

template<typename T >
asset& scorum::protocol::asset::operator+= ( const T &  o_amount)
inline

Definition at line 58 of file asset.hpp.

◆ operator-()

asset scorum::protocol::asset::operator- ( ) const
inline

Definition at line 78 of file asset.hpp.

◆ operator-=() [1/2]

asset& scorum::protocol::asset::operator-= ( const asset o)
inline

Definition at line 73 of file asset.hpp.

◆ operator-=() [2/2]

template<typename T >
asset& scorum::protocol::asset::operator-= ( const T &  o_amount)
inline

Definition at line 68 of file asset.hpp.

◆ operator/=()

template<typename T >
asset& scorum::protocol::asset::operator/= ( const T &  o_amount)
inline

Definition at line 87 of file asset.hpp.

◆ precision()

int64_t scorum::protocol::asset::precision ( ) const

Definition at line 48 of file asset.cpp.

◆ symbol()

asset_symbol_type scorum::protocol::asset::symbol ( ) const
inline

Definition at line 32 of file asset.hpp.

◆ symbol_name()

std::string scorum::protocol::asset::symbol_name ( ) const

Definition at line 41 of file asset.cpp.

◆ to_real()

double scorum::protocol::asset::to_real ( ) const
inline

Definition at line 46 of file asset.hpp.

◆ to_string()

std::string scorum::protocol::asset::to_string ( ) const

Definition at line 69 of file asset.cpp.

Friends And Related Function Documentation

◆ fc::reflector< asset >

friend struct fc::reflector< asset >
friend

Definition at line 177 of file asset.hpp.

◆ operator!=

bool operator!= ( const asset a,
const asset b 
)
friend

Definition at line 115 of file asset.hpp.

◆ operator%

asset operator% ( const asset a,
const asset b 
)
friend

Definition at line 177 of file asset.hpp.

◆ operator* [1/3]

asset operator* ( const asset a,
const odds k 
)
friend

Definition at line 164 of file asset.hpp.

◆ operator* [2/3]

template<typename T >
asset operator* ( const asset a,
const T &  b_amount 
)
friend

Definition at line 151 of file asset.hpp.

◆ operator* [3/3]

template<typename FractionalNumerator , typename FractionalDenominator >
asset operator* ( const asset a,
const utils::fraction< FractionalNumerator, FractionalDenominator > &  fraction 
)
friend

Definition at line 158 of file asset.hpp.

◆ operator+ [1/2]

asset operator+ ( const asset a,
const asset b 
)
friend

Definition at line 133 of file asset.hpp.

◆ operator+ [2/2]

template<typename T >
asset operator+ ( const asset a,
const T &  b_amount 
)
friend

Definition at line 127 of file asset.hpp.

◆ operator- [1/2]

asset operator- ( const asset a,
const asset b 
)
friend

Definition at line 145 of file asset.hpp.

◆ operator- [2/2]

template<typename T >
asset operator- ( const asset a,
const T &  b_amount 
)
friend

Definition at line 139 of file asset.hpp.

◆ operator/

template<typename T >
asset operator/ ( const asset a,
const T &  b_amount 
)
friend

Definition at line 170 of file asset.hpp.

◆ operator<

bool operator< ( const asset a,
const asset b 
)
friend

Definition at line 106 of file asset.hpp.

◆ operator<=

bool operator<= ( const asset a,
const asset b 
)
friend

Definition at line 111 of file asset.hpp.

◆ operator==

bool operator== ( const asset a,
const asset b 
)
friend

Definition at line 102 of file asset.hpp.

◆ operator>

bool operator> ( const asset a,
const asset b 
)
friend

Definition at line 119 of file asset.hpp.

◆ operator>=

bool operator>= ( const asset a,
const asset b 
)
friend

Definition at line 123 of file asset.hpp.

Member Data Documentation

◆ amount

share_type scorum::protocol::asset::amount

Definition at line 31 of file asset.hpp.


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