rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ripple::MPTAmount Class Reference

#include <MPTAmount.h>

Inheritance diagram for ripple::MPTAmount:
Inheritance graph
[legend]
Collaboration diagram for ripple::MPTAmount:
Collaboration graph
[legend]

Public Types

using value_type = std::int64_t
 

Public Member Functions

 MPTAmount ()=default
 
constexpr MPTAmount (MPTAmount const &other)=default
 
constexpr MPTAmountoperator= (MPTAmount const &other)=default
 
 MPTAmount (Number const &x)
 
constexpr MPTAmount (value_type value)
 
constexpr MPTAmountoperator= (beast::Zero)
 
MPTAmountoperator+= (MPTAmount const &other)
 
MPTAmountoperator-= (MPTAmount const &other)
 
MPTAmount operator- () const
 
bool operator== (MPTAmount const &other) const
 
bool operator== (value_type other) const
 
bool operator< (MPTAmount const &other) const
 
constexpr operator bool () const noexcept
 Returns true if the amount is not zero.
 
 operator Number () const noexcept
 
constexpr int signum () const noexcept
 Return the sign of the amount.
 
constexpr value_type value () const
 Returns the underlying value.
 

Static Public Member Functions

static MPTAmount minPositiveAmount ()
 

Protected Attributes

value_type value_
 

Detailed Description

Definition at line 17 of file MPTAmount.h.

Member Typedef Documentation

◆ value_type

Definition at line 23 of file MPTAmount.h.

Constructor & Destructor Documentation

◆ MPTAmount() [1/4]

ripple::MPTAmount::MPTAmount ( )
default

◆ MPTAmount() [2/4]

constexpr ripple::MPTAmount::MPTAmount ( MPTAmount const &  other)
constexprdefault

◆ MPTAmount() [3/4]

ripple::MPTAmount::MPTAmount ( Number const &  x)
explicit

Definition at line 35 of file MPTAmount.h.

◆ MPTAmount() [4/4]

constexpr ripple::MPTAmount::MPTAmount ( value_type  value)
explicitconstexpr

Definition at line 85 of file MPTAmount.h.

Member Function Documentation

◆ operator=() [1/2]

constexpr MPTAmount & ripple::MPTAmount::operator= ( MPTAmount const &  other)
constexprdefault

◆ operator=() [2/2]

constexpr MPTAmount & ripple::MPTAmount::operator= ( beast::Zero  )
constexpr

Definition at line 90 of file MPTAmount.h.

◆ operator+=()

MPTAmount & ripple::MPTAmount::operator+= ( MPTAmount const &  other)

Definition at line 6 of file MPTAmount.cpp.

◆ operator-=()

MPTAmount & ripple::MPTAmount::operator-= ( MPTAmount const &  other)

Definition at line 13 of file MPTAmount.cpp.

◆ operator-()

MPTAmount ripple::MPTAmount::operator- ( ) const

Definition at line 20 of file MPTAmount.cpp.

◆ operator==() [1/2]

bool ripple::MPTAmount::operator== ( MPTAmount const &  other) const

Definition at line 26 of file MPTAmount.cpp.

◆ operator==() [2/2]

bool ripple::MPTAmount::operator== ( value_type  other) const

Definition at line 32 of file MPTAmount.cpp.

◆ operator<()

bool ripple::MPTAmount::operator< ( MPTAmount const &  other) const

Definition at line 37 of file MPTAmount.cpp.

◆ operator bool()

constexpr ripple::MPTAmount::operator bool ( ) const
explicitconstexprnoexcept

Returns true if the amount is not zero.

Definition at line 97 of file MPTAmount.h.

◆ operator Number()

ripple::MPTAmount::operator Number ( ) const
noexcept

Definition at line 65 of file MPTAmount.h.

◆ signum()

constexpr int ripple::MPTAmount::signum ( ) const
constexprnoexcept

Return the sign of the amount.

Definition at line 104 of file MPTAmount.h.

◆ value()

constexpr MPTAmount::value_type ripple::MPTAmount::value ( ) const
constexpr

Returns the underlying value.

Code SHOULD NOT call this function unless the type has been abstracted away, e.g. in a templated function.

Definition at line 114 of file MPTAmount.h.

◆ minPositiveAmount()

MPTAmount ripple::MPTAmount::minPositiveAmount ( )
static

Definition at line 44 of file MPTAmount.cpp.

Member Data Documentation

◆ value_

value_type ripple::MPTAmount::value_
protected

Definition at line 26 of file MPTAmount.h.