xrpld
Loading...
Searching...
No Matches
xrpl::STCurrency Class Referencefinal

#include <STCurrency.h>

Inheritance diagram for xrpl::STCurrency:
Collaboration diagram for xrpl::STCurrency:

Public Types

using value_type = Currency

Public Member Functions

 STCurrency ()=default
 STCurrency (SerialIter &sit, SField const &name)
 STCurrency (SField const &name, Currency const &currency)
 STCurrency (SField const &name)
Currency const & currency () const
Currency const & value () const noexcept
void setCurrency (Currency const &currency)
SerializedTypeID getSType () const override
std::string getText () const override
json::Value getJson (JsonOptions) const override
void add (Serializer &s) const override
bool isEquivalent (STBase const &t) const override
bool isDefault () const override
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
virtual std::string getFullText () const
void setFName (SField const &n)
 A STBase is a field.
SField const & getFName () const
void addFieldID (Serializer &s) const

Static Protected Member Functions

template<class T>
static STBaseemplace (std::size_t n, void *buf, T &&val)

Private Member Functions

STBasecopy (std::size_t n, void *buf) const override
STBasemove (std::size_t n, void *buf) override

Static Private Member Functions

static std::unique_ptr< STCurrencyconstruct (SerialIter &, SField const &name)

Private Attributes

Currency currency_
SField const * fName_

Friends

class detail::STVar

Detailed Description

Definition at line 11 of file STCurrency.h.

Member Typedef Documentation

◆ value_type

Definition at line 17 of file STCurrency.h.

Constructor & Destructor Documentation

◆ STCurrency() [1/4]

xrpl::STCurrency::STCurrency ( )
default

◆ STCurrency() [2/4]

xrpl::STCurrency::STCurrency ( SerialIter & sit,
SField const & name )
explicit

Definition at line 22 of file STCurrency.cpp.

◆ STCurrency() [3/4]

xrpl::STCurrency::STCurrency ( SField const & name,
Currency const & currency )
explicit

Definition at line 27 of file STCurrency.cpp.

◆ STCurrency() [4/4]

xrpl::STCurrency::STCurrency ( SField const & name)
explicit

Definition at line 18 of file STCurrency.cpp.

Member Function Documentation

◆ currency()

Currency const & xrpl::STCurrency::currency ( ) const
nodiscard

Definition at line 69 of file STCurrency.h.

◆ value()

Currency const & xrpl::STCurrency::value ( ) const
nodiscardnoexcept

Definition at line 75 of file STCurrency.h.

◆ setCurrency()

void xrpl::STCurrency::setCurrency ( Currency const & currency)

Definition at line 81 of file STCurrency.h.

◆ getSType()

SerializedTypeID xrpl::STCurrency::getSType ( ) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 33 of file STCurrency.cpp.

◆ getText()

std::string xrpl::STCurrency::getText ( ) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 39 of file STCurrency.cpp.

◆ getJson()

json::Value xrpl::STCurrency::getJson ( JsonOptions ) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 45 of file STCurrency.cpp.

◆ add()

void xrpl::STCurrency::add ( Serializer & s) const
overridevirtual

Reimplemented from xrpl::STBase.

Definition at line 51 of file STCurrency.cpp.

◆ isEquivalent()

bool xrpl::STCurrency::isEquivalent ( STBase const & t) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 57 of file STCurrency.cpp.

◆ isDefault()

bool xrpl::STCurrency::isDefault ( ) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 64 of file STCurrency.cpp.

◆ construct()

std::unique_ptr< STCurrency > xrpl::STCurrency::construct ( SerialIter & sit,
SField const & name )
staticprivate

Definition at line 70 of file STCurrency.cpp.

◆ copy()

STBase * xrpl::STCurrency::copy ( std::size_t n,
void * buf ) const
overrideprivatevirtual

Reimplemented from xrpl::STBase.

Definition at line 76 of file STCurrency.cpp.

◆ move()

STBase * xrpl::STCurrency::move ( std::size_t n,
void * buf )
overrideprivatevirtual

Reimplemented from xrpl::STBase.

Definition at line 82 of file STCurrency.cpp.

◆ operator==()

bool xrpl::STBase::operator== ( STBase const & t) const
inherited

Definition at line 36 of file STBase.cpp.

◆ operator!=()

bool xrpl::STBase::operator!= ( STBase const & t) const
inherited

Definition at line 42 of file STBase.cpp.

◆ downcast() [1/3]

template<class D>
D & xrpl::STBase::downcast ( )
inherited

Definition at line 195 of file STBase.h.

◆ downcast() [2/3]

template<class D>
D const & xrpl::STBase::downcast ( ) const
inherited

◆ downcast() [3/3]

template<class D>
D const & xrpl::STBase::downcast ( ) const
nodiscardinherited

Definition at line 205 of file STBase.h.

◆ getFullText()

std::string xrpl::STBase::getFullText ( ) const
nodiscardvirtualinherited

Reimplemented in xrpl::STAmount, xrpl::STArray, xrpl::STLedgerEntry, xrpl::STObject, and xrpl::STTx.

Definition at line 66 of file STBase.cpp.

◆ setFName()

void xrpl::STBase::setFName ( SField const & n)
inherited

A STBase is a field.

This sets the name.

Definition at line 119 of file STBase.cpp.

◆ getFName()

SField const & xrpl::STBase::getFName ( ) const
nodiscardinherited

Definition at line 126 of file STBase.cpp.

◆ addFieldID()

void xrpl::STBase::addFieldID ( Serializer & s) const
inherited

Definition at line 132 of file STBase.cpp.

◆ emplace()

template<class T>
STBase * xrpl::STBase::emplace ( std::size_t n,
void * buf,
T && val )
staticprotectedinherited

Definition at line 215 of file STBase.h.

◆ detail::STVar

friend class detail::STVar
friend

Definition at line 62 of file STCurrency.h.

Member Data Documentation

◆ currency_

Currency xrpl::STCurrency::currency_
private

Definition at line 14 of file STCurrency.h.

◆ fName_

SField const* xrpl::STBase::fName_
privateinherited

Definition at line 118 of file STBase.h.