|
xrpld
|
A serializable number. More...
#include <STNumber.h>


Public Types | |
| using | value_type = Number |
Public Member Functions | |
| STNumber ()=default | |
| STNumber (SField const &field, Number const &value=Number()) | |
| STNumber (SerialIter &sit, SField const &field) | |
| SerializedTypeID | getSType () const override |
| std::string | getText () const override |
| void | add (Serializer &s) const override |
| Number const & | value () const |
| void | setValue (Number const &v) |
| STNumber & | operator= (Number const &rhs) |
| bool | isEquivalent (STBase const &t) const override |
| bool | isDefault () const override |
| void | associateAsset (Asset const &a) override |
| operator Number () const | |
| STBase () | |
| STBase (STBase const &)=default | |
| STBase (SField const &n) | |
| 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 |
| virtual std::string | getFullText () const |
| virtual json::Value | getJson (JsonOptions=JsonOptions::Values::None) const |
| void | setFName (SField const &n) |
| A STBase is a field. | |
| SField const & | getFName () const |
| void | addFieldID (Serializer &s) const |
Public Attributes | |
| friend | Object |
Static Protected Member Functions | |
| template<class T> | |
| static STBase * | emplace (std::size_t n, void *buf, T &&val) |
Protected Attributes | |
| std::optional< Asset > | asset_ |
Private Member Functions | |
| STBase * | copy (std::size_t n, void *buf) const override |
| STBase * | move (std::size_t n, void *buf) override |
Static Private Member Functions | |
| static auto & | getCounter () noexcept |
Private Attributes | |
| Number | value_ |
| SField const * | fName_ |
A serializable number.
This type is-a Number, and can be used everywhere that is accepted. This type simply integrates Number with the serialization framework, letting it be used for fields in ledger entries and transactions. It is effectively an STAmount sans Asset: it can represent a value of any token type (XRP, IOU, or MPT) without paying the storage cost of duplicating asset information that may be deduced from the context.
STNumber derives from STTakesAsset, so that it can be associated with the related Asset during transaction processing. Which asset is relevant depends on the object and transaction. As of this writing, only Vault, LoanBroker, and Loan objects use STNumber fields. All of those fields represent amounts of the Vault's Asset, so they should be associated with the Vault's Asset.
e.g. associateAsset(*loanSle, asset); associateAsset(*brokerSle, asset); associateAsset(*vaultSle, asset);
Definition at line 41 of file STNumber.h.
| using xrpl::STNumber::value_type = Number |
Definition at line 47 of file STNumber.h.
|
default |
Definition at line 30 of file STNumber.cpp.
| xrpl::STNumber::STNumber | ( | SerialIter & | sit, |
| SField const & | field ) |
Definition at line 34 of file STNumber.cpp.
|
nodiscardoverridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 44 of file STNumber.cpp.
|
nodiscardoverridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 50 of file STNumber.cpp.
|
overridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 69 of file STNumber.cpp.
|
nodiscard |
Definition at line 114 of file STNumber.cpp.
| void xrpl::STNumber::setValue | ( | Number const & | v | ) |
Definition at line 120 of file STNumber.cpp.
Definition at line 66 of file STNumber.h.
|
nodiscardoverridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 138 of file STNumber.cpp.
|
nodiscardoverridevirtual |
Reimplemented from xrpl::STBase.
Definition at line 147 of file STNumber.cpp.
|
overridevirtual |
Reimplemented from xrpl::STTakesAsset.
Definition at line 56 of file STNumber.cpp.
| xrpl::STNumber::operator Number | ( | ) | const |
Definition at line 80 of file STNumber.h.
|
overrideprivatevirtual |
Reimplemented from xrpl::STBase.
Definition at line 126 of file STNumber.cpp.
|
overrideprivatevirtual |
Reimplemented from xrpl::STBase.
Definition at line 132 of file STNumber.cpp.
|
inherited |
Definition at line 134 of file STBase.cpp.
|
defaultinherited |
|
explicitinherited |
Definition at line 139 of file STBase.cpp.
|
inherited |
Definition at line 36 of file STBase.cpp.
|
inherited |
|
nodiscardinherited |
|
nodiscardvirtualinherited |
Reimplemented in xrpl::STAmount, xrpl::STArray, xrpl::STLedgerEntry, xrpl::STObject, and xrpl::STTx.
Definition at line 60 of file STBase.cpp.
|
nodiscardvirtualinherited |
Reimplemented in xrpl::STAmount, xrpl::STArray, xrpl::STCurrency, xrpl::STInteger< Integer >, xrpl::STInteger< std::int32_t >, xrpl::STInteger< std::uint16_t >, xrpl::STInteger< std::uint32_t >, xrpl::STInteger< std::uint64_t >, xrpl::STInteger< unsigned char >, xrpl::STIssue, xrpl::STLedgerEntry, xrpl::STObject, xrpl::STPathSet, xrpl::STTx, xrpl::STVector256, and xrpl::STXChainBridge.
Definition at line 85 of file STBase.cpp.
|
inherited |
|
nodiscardinherited |
Definition at line 120 of file STBase.cpp.
|
inherited |
Definition at line 126 of file STBase.cpp.
|
staticprotectedinherited |
|
staticprivatenoexceptinherited |
Definition at line 113 of file CountedObject.h.
|
private |
Definition at line 44 of file STNumber.h.
|
protectedinherited |
Definition at line 27 of file STTakesAsset.h.
|
inherited |
Definition at line 138 of file CountedObject.h.