hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::interface::Amount Class Referencefinal

#include "amount.hpp"

Inheritance diagram for shared_model::interface::Amount:
Inheritance graph
Collaboration diagram for shared_model::interface::Amount:
Collaboration graph

Classes

struct  Impl
 

Public Member Functions

 Amount (std::string_view amount)
 
 Amount (types::PrecisionType precision)
 
 Amount (Amount const &other)
 
 Amount (Amount &&other) noexcept
 
Amountoperator= (Amount const &other)
 
Amountoperator= (Amount &&other) noexcept
 
 ~Amount () override
 
int sign () const
 
types::PrecisionType precision () const
 
std::string const & toStringRepr () const
 
Amountoperator+= (Amount const &other)
 
Amountoperator-= (Amount const &other)
 
bool operator== (const ModelType &rhs) const override
 
std::string toString () const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< Amount >
virtual bool operator== (const ModelType &rhs) const=0
 
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 

Additional Inherited Members

- Public Types inherited from shared_model::interface::ModelPrimitive< Amount >
using ModelType = Amount
 

Detailed Description

Representation of fixed point number

Constructor & Destructor Documentation

◆ Amount() [1/4]

Amount::Amount ( std::string_view  amount)
explicit
Here is the caller graph for this function:

◆ Amount() [2/4]

Amount::Amount ( types::PrecisionType  precision)
explicit

◆ Amount() [3/4]

Amount::Amount ( Amount const &  other)

◆ Amount() [4/4]

Amount::Amount ( Amount &&  other)
noexcept

◆ ~Amount()

Amount::~Amount ( )
overridedefault
Here is the caller graph for this function:

Member Function Documentation

◆ operator+=()

Amount & Amount::operator+= ( Amount const &  other)

◆ operator-=()

Amount & Amount::operator-= ( Amount const &  other)

◆ operator=() [1/2]

Amount & Amount::operator= ( Amount const &  other)
Here is the call graph for this function:

◆ operator=() [2/2]

Amount & Amount::operator= ( Amount &&  other)
noexcept
Here is the call graph for this function:

◆ operator==()

bool Amount::operator== ( const ModelType rhs) const
override

Checks equality of objects inside

Parameters
rhs- other wrapped value
Returns
true, if wrapped objects are same

◆ precision()

types::PrecisionType Amount::precision ( ) const

Gets the position of precision

Returns
the position of precision
Here is the caller graph for this function:

◆ sign()

int Amount::sign ( ) const

Returns a value less than zero if Amount is negative, a value greater than zero if Amount is positive, and zero if Amount is zero.

Here is the caller graph for this function:

◆ toString()

std::string Amount::toString ( ) const
overridevirtual

Stringify the data.

Returns
the content of asset.

Reimplemented from shared_model::interface::ModelPrimitive< Amount >.

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

◆ toStringRepr()

std::string const & Amount::toStringRepr ( ) const

String representation.

Returns
string representation of the asset.
Here is the caller graph for this function:

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