xrpld
Loading...
Searching...
No Matches
xrpl::MPTAmount Class Reference

#include <MPTAmount.h>

Inheritance diagram for xrpl::MPTAmount:
Collaboration diagram for xrpl::MPTAmount:

Public Types

using value_type = std::int64_t

Public Member Functions

 MPTAmount ()=default
constexpr MPTAmount (MPTAmount const &other)=default
constexpr MPTAmount (beast::Zero)
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 16 of file MPTAmount.h.

Member Typedef Documentation

◆ value_type

Definition at line 22 of file MPTAmount.h.

Constructor & Destructor Documentation

◆ MPTAmount() [1/5]

xrpl::MPTAmount::MPTAmount ( )
default

◆ MPTAmount() [2/5]

xrpl::MPTAmount::MPTAmount ( MPTAmount const & other)
constexprdefault

◆ MPTAmount() [3/5]

xrpl::MPTAmount::MPTAmount ( beast::Zero )
constexpr

Definition at line 89 of file MPTAmount.h.

◆ MPTAmount() [4/5]

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

Definition at line 35 of file MPTAmount.h.

◆ MPTAmount() [5/5]

xrpl::MPTAmount::MPTAmount ( value_type value)
explicitconstexpr

Definition at line 85 of file MPTAmount.h.

Member Function Documentation

◆ operator=() [1/2]

MPTAmount & xrpl::MPTAmount::operator= ( MPTAmount const & other)
constexprdefault

◆ operator=() [2/2]

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

Definition at line 95 of file MPTAmount.h.

◆ operator+=()

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

Definition at line 6 of file MPTAmount.cpp.

◆ operator-=()

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

Definition at line 13 of file MPTAmount.cpp.

◆ operator-()

MPTAmount xrpl::MPTAmount::operator- ( ) const

Definition at line 20 of file MPTAmount.cpp.

◆ operator==() [1/2]

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

Definition at line 26 of file MPTAmount.cpp.

◆ operator==() [2/2]

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

Definition at line 32 of file MPTAmount.cpp.

◆ operator<()

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

Definition at line 37 of file MPTAmount.cpp.

◆ operator bool()

xrpl::MPTAmount::operator bool ( ) const
explicitconstexprnoexcept

Returns true if the amount is not zero.

Definition at line 102 of file MPTAmount.h.

◆ operator Number()

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

Definition at line 65 of file MPTAmount.h.

◆ signum()

int xrpl::MPTAmount::signum ( ) const
nodiscardconstexprnoexcept

Return the sign of the amount.

Definition at line 110 of file MPTAmount.h.

◆ value()

MPTAmount::value_type xrpl::MPTAmount::value ( ) const
nodiscardconstexpr

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 122 of file MPTAmount.h.

◆ minPositiveAmount()

MPTAmount xrpl::MPTAmount::minPositiveAmount ( )
static

Definition at line 44 of file MPTAmount.cpp.

Member Data Documentation

◆ value_

value_type xrpl::MPTAmount::value_ {}
protected

Definition at line 25 of file MPTAmount.h.