|
rippled
|
#include <STAmount.h>


Classes | |
| struct | unchecked |
Public Types | |
| using | mantissa_type = std::uint64_t |
| using | exponent_type = int |
| using | rep = std::pair< mantissa_type, exponent_type > |
| using | value_type = STAmount |
Public Member Functions | |
| STAmount (SerialIter &sit, SField const &name) | |
| template<AssetType A> | |
| STAmount (SField const &name, A const &asset, mantissa_type mantissa, exponent_type exponent, bool negative, unchecked) | |
| template<AssetType A> | |
| STAmount (A const &asset, mantissa_type mantissa, exponent_type exponent, bool negative, unchecked) | |
| template<AssetType A> | |
| STAmount (SField const &name, A const &asset, mantissa_type mantissa=0, exponent_type exponent=0, bool negative=false) | |
| STAmount (SField const &name, std::int64_t mantissa) | |
| STAmount (SField const &name, std::uint64_t mantissa=0, bool negative=false) | |
| STAmount (std::uint64_t mantissa=0, bool negative=false) | |
| STAmount (SField const &name, STAmount const &amt) | |
| template<AssetType A> | |
| STAmount (A const &asset, std::uint64_t mantissa=0, int exponent=0, bool negative=false) | |
| template<AssetType A> | |
| STAmount (A const &asset, std::uint32_t mantissa, int exponent=0, bool negative=false) | |
| template<AssetType A> | |
| STAmount (A const &asset, std::int64_t mantissa, int exponent=0) | |
| template<AssetType A> | |
| STAmount (A const &asset, int mantissa, int exponent=0) | |
| template<AssetType A> | |
| STAmount (A const &asset, Number const &number) | |
| STAmount (IOUAmount const &amount, Issue const &issue) | |
| STAmount (XRPAmount const &amount) | |
| STAmount (MPTAmount const &amount, MPTIssue const &mptIssue) | |
| operator Number () const | |
| int | exponent () const noexcept |
| bool | integral () const noexcept |
| bool | native () const noexcept |
| template<ValidIssueType TIss> | |
| constexpr bool | holds () const noexcept |
| bool | negative () const noexcept |
| std::uint64_t | mantissa () const noexcept |
| Asset const & | asset () const |
| template<ValidIssueType TIss> | |
| constexpr TIss const & | get () const |
| Issue const & | issue () const |
| Currency const & | getCurrency () const |
| AccountID const & | getIssuer () const |
| int | signum () const noexcept |
| STAmount | zeroed () const |
| Returns a zero value with the same issuer and currency. | |
| void | setJson (Json::Value &) const |
| STAmount const & | value () const noexcept |
| operator bool () const noexcept | |
| STAmount & | operator+= (STAmount const &) |
| STAmount & | operator-= (STAmount const &) |
| STAmount & | operator= (beast::Zero) |
| STAmount & | operator= (XRPAmount const &amount) |
| STAmount & | operator= (Number const &) |
| void | negate () |
| void | clear () |
| void | clear (Asset const &asset) |
| void | setIssuer (AccountID const &uIssuer) |
| void | setIssue (Asset const &asset) |
| Set the Issue for this amount. | |
| SerializedTypeID | getSType () const override |
| std::string | getFullText () const override |
| std::string | getText () const override |
| Json::Value | getJson (JsonOptions=JsonOptions::none) const override |
| void | add (Serializer &s) const override |
| bool | isEquivalent (STBase const &t) const override |
| bool | isDefault () const override |
| XRPAmount | xrp () const |
| IOUAmount | iou () const |
| MPTAmount | mpt () const |
| template<ValidIssueType TIss> | |
| constexpr TIss const & | get () const |
| bool | operator== (STBase const &t) const |
| bool | operator!= (STBase const &t) const |
| template<class D > | |
| D & | downcast () |
| template<class D > | |
| D const & | downcast () const |
| template<class D > | |
| D const & | downcast () const |
| void | setFName (SField const &n) |
| A STBase is a field. | |
| SField const & | getFName () const |
| void | addFieldID (Serializer &s) const |
Static Public Attributes | |
| static int const | cMinOffset = -96 |
| static int const | cMaxOffset = 80 |
| static constexpr std::uint64_t | cMinValue = 1'000'000'000'000'000ull |
| static constexpr std::uint64_t | cMaxValue = cMinValue * 10 - 1 |
| static constexpr std::uint64_t | cMaxNative = 9'000'000'000'000'000'000ull |
| static constexpr std::uint64_t | cMaxNativeN = 100'000'000'000'000'000ull |
| static constexpr std::uint64_t | cIssuedCurrency = 0x8'000'000'000'000'000ull |
| static constexpr std::uint64_t | cPositive = 0x4'000'000'000'000'000ull |
| static constexpr std::uint64_t | cMPToken = 0x2'000'000'000'000'000ull |
| static constexpr std::uint64_t | cValueMask = ~(cPositive | cMPToken) |
| static std::uint64_t const | uRateOne = getRate(STAmount(1), STAmount(1)) |
Static Protected Member Functions | |
| template<class T > | |
| static STBase * | emplace (std::size_t n, void *buf, T &&val) |
Private Member Functions | |
| void | set (std::int64_t v) |
| void | canonicalize () |
| STBase * | copy (std::size_t n, void *buf) const override |
| STBase * | move (std::size_t n, void *buf) override |
| STAmount & | operator= (IOUAmount const &iou) |
Static Private Member Functions | |
| template<AssetType A> | |
| static STAmount | fromNumber (A const &asset, Number const &number) |
| static std::unique_ptr< STAmount > | construct (SerialIter &, SField const &name) |
| static auto & | getCounter () noexcept |
Private Attributes | |
| Asset | mAsset |
| mantissa_type | mValue {} |
| exponent_type | mOffset |
| bool | mIsNegative {} |
| SField const * | fName |
Friends | |
| class | detail::STVar |
| STAmount | operator+ (STAmount const &v1, STAmount const &v2) |
Definition at line 29 of file STAmount.h.
Definition at line 32 of file STAmount.h.
| using xrpl::STAmount::exponent_type = int |
Definition at line 33 of file STAmount.h.
Definition at line 34 of file STAmount.h.
| using xrpl::STAmount::value_type = STAmount |
Definition at line 43 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | SerialIter & | sit, |
| SField const & | name | ||
| ) |
Definition at line 102 of file STAmount.cpp.
| xrpl::STAmount::STAmount | ( | SField const & | name, |
| A const & | asset, | ||
| mantissa_type | mantissa, | ||
| exponent_type | exponent, | ||
| bool | negative, | ||
| unchecked | |||
| ) |
Definition at line 296 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| mantissa_type | mantissa, | ||
| exponent_type | exponent, | ||
| bool | negative, | ||
| unchecked | |||
| ) |
Definition at line 308 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | SField const & | name, |
| A const & | asset, | ||
| mantissa_type | mantissa = 0, |
||
| exponent_type | exponent = 0, |
||
| bool | negative = false |
||
| ) |
Definition at line 319 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | SField const & | name, |
| std::int64_t | mantissa | ||
| ) |
Definition at line 183 of file STAmount.cpp.
| xrpl::STAmount::STAmount | ( | SField const & | name, |
| std::uint64_t | mantissa = 0, |
||
| bool | negative = false |
||
| ) |
Definition at line 189 of file STAmount.cpp.
|
explicit |
Definition at line 213 of file STAmount.cpp.
Definition at line 198 of file STAmount.cpp.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| std::uint64_t | mantissa = 0, |
||
| int | exponent = 0, |
||
| bool | negative = false |
||
| ) |
Definition at line 108 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| std::uint32_t | mantissa, | ||
| int | exponent = 0, |
||
| bool | negative = false |
||
| ) |
Definition at line 352 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| std::int64_t | mantissa, | ||
| int | exponent = 0 |
||
| ) |
Definition at line 344 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| int | mantissa, | ||
| int | exponent = 0 |
||
| ) |
Definition at line 358 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | A const & | asset, |
| Number const & | number | ||
| ) |
Definition at line 125 of file STAmount.h.
Definition at line 364 of file STAmount.h.
| xrpl::STAmount::STAmount | ( | XRPAmount const & | amount | ) |
Definition at line 222 of file STAmount.cpp.
Definition at line 375 of file STAmount.h.
| xrpl::STAmount::operator Number | ( | ) | const |
Definition at line 505 of file STAmount.h.
|
noexcept |
Definition at line 420 of file STAmount.h.
|
noexcept |
Definition at line 426 of file STAmount.h.
|
noexcept |
Definition at line 432 of file STAmount.h.
|
constexprnoexcept |
Definition at line 439 of file STAmount.h.
|
noexcept |
Definition at line 445 of file STAmount.h.
|
noexcept |
Definition at line 451 of file STAmount.h.
| Asset const & xrpl::STAmount::asset | ( | ) | const |
Definition at line 457 of file STAmount.h.
|
constexpr |
| Issue const & xrpl::STAmount::issue | ( | ) | const |
Definition at line 470 of file STAmount.h.
| Currency const & xrpl::STAmount::getCurrency | ( | ) | const |
Definition at line 476 of file STAmount.h.
| AccountID const & xrpl::STAmount::getIssuer | ( | ) | const |
Definition at line 482 of file STAmount.h.
|
noexcept |
Definition at line 488 of file STAmount.h.
| STAmount xrpl::STAmount::zeroed | ( | ) | const |
Returns a zero value with the same issuer and currency.
Definition at line 494 of file STAmount.h.
| void xrpl::STAmount::setJson | ( | Json::Value & | elem | ) | const |
Definition at line 616 of file STAmount.cpp.
|
noexcept |
Definition at line 578 of file STAmount.h.
|
explicitnoexcept |
Definition at line 499 of file STAmount.h.
Definition at line 348 of file STAmount.cpp.
Definition at line 355 of file STAmount.cpp.
| STAmount & xrpl::STAmount::operator= | ( | beast::Zero | ) |
Definition at line 516 of file STAmount.h.
Definition at line 523 of file STAmount.h.
Definition at line 323 of file STAmount.cpp.
| void xrpl::STAmount::negate | ( | ) |
Definition at line 548 of file STAmount.h.
| void xrpl::STAmount::clear | ( | ) |
Definition at line 555 of file STAmount.h.
| void xrpl::STAmount::clear | ( | Asset const & | asset | ) |
Definition at line 565 of file STAmount.h.
| void xrpl::STAmount::setIssuer | ( | AccountID const & | uIssuer | ) |
Definition at line 572 of file STAmount.h.
| void xrpl::STAmount::setIssue | ( | Asset const & | asset | ) |
Set the Issue for this amount.
Definition at line 435 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 640 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 646 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 656 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 744 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 752 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 796 of file STAmount.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 803 of file STAmount.cpp.
| XRPAmount xrpl::STAmount::xrp | ( | ) | const |
Definition at line 261 of file STAmount.cpp.
| IOUAmount xrpl::STAmount::iou | ( | ) | const |
Definition at line 276 of file STAmount.cpp.
| MPTAmount xrpl::STAmount::mpt | ( | ) | const |
Definition at line 291 of file STAmount.cpp.
|
staticprivate |
Definition at line 531 of file STAmount.h.
|
staticprivate |
Definition at line 238 of file STAmount.cpp.
|
private |
Definition at line 958 of file STAmount.cpp.
|
private |
Definition at line 827 of file STAmount.cpp.
|
overrideprivatevirtual |
Reimplemented from xrpl::STBase.
Definition at line 244 of file STAmount.cpp.
|
overrideprivatevirtual |
Reimplemented from xrpl::STBase.
Definition at line 250 of file STAmount.cpp.
Definition at line 306 of file STAmount.cpp.
|
constexpr |
Definition at line 464 of file STAmount.h.
|
inherited |
Definition at line 35 of file STBase.cpp.
|
inherited |
Definition at line 41 of file STBase.cpp.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 125 of file STBase.cpp.
|
inherited |
Definition at line 131 of file STBase.cpp.
|
staticprotectedinherited |
|
staticprivatenoexceptinherited |
Definition at line 109 of file CountedObject.h.
|
friend |
Definition at line 289 of file STAmount.h.
Definition at line 362 of file STAmount.cpp.
|
private |
Definition at line 37 of file STAmount.h.
|
private |
Definition at line 38 of file STAmount.h.
|
private |
Definition at line 39 of file STAmount.h.
|
private |
Definition at line 40 of file STAmount.h.
|
static |
Definition at line 45 of file STAmount.h.
|
static |
Definition at line 46 of file STAmount.h.
|
staticconstexpr |
Definition at line 49 of file STAmount.h.
|
staticconstexpr |
Definition at line 51 of file STAmount.h.
|
staticconstexpr |
Definition at line 53 of file STAmount.h.
|
staticconstexpr |
Definition at line 56 of file STAmount.h.
|
staticconstexpr |
Definition at line 57 of file STAmount.h.
|
staticconstexpr |
Definition at line 58 of file STAmount.h.
|
staticconstexpr |
Definition at line 59 of file STAmount.h.
|
staticconstexpr |
Definition at line 60 of file STAmount.h.
|
static |
Definition at line 62 of file STAmount.h.