rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
xrpl::STTakesAsset Class Reference

Intermediate class for any STBase-derived class to store an Asset. More...

#include <STTakesAsset.h>

Inheritance diagram for xrpl::STTakesAsset:
Inheritance graph
[legend]
Collaboration diagram for xrpl::STTakesAsset:
Collaboration graph
[legend]

Public Member Functions

virtual void associateAsset (Asset const &a)
 
 STBase ()
 
 STBase (STBase const &)=default
 
 STBase (SField const &n)
 
STBaseoperator= (STBase const &t)
 
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 SerializedTypeID getSType () const
 
virtual std::string getFullText () const
 
virtual std::string getText () const
 
virtual Json::Value getJson (JsonOptions=JsonOptions::none) const
 
virtual void add (Serializer &s) const
 
virtual bool isEquivalent (STBase const &t) const
 
virtual bool isDefault () 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)
 

Protected Attributes

std::optional< Assetasset_
 

Private Member Functions

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

Private Attributes

SField const * fName
 

Detailed Description

Intermediate class for any STBase-derived class to store an Asset.

In the class definition, this class should be specified as a base class instead of STBase.

Specifically, the Asset is only stored and used at runtime. It should not be serialized to the ledger.

The derived class decides what to do with the Asset, and when. It will not necessarily be set at any given time. As of this writing, only STNumber uses it to round the stored Number to the Asset's precision both when associated, and when serializing the Number.

Definition at line 21 of file STTakesAsset.h.

Member Function Documentation

◆ associateAsset()

void xrpl::STTakesAsset::associateAsset ( Asset const &  a)
virtual

Reimplemented in xrpl::STNumber.

Definition at line 35 of file STTakesAsset.h.

◆ STBase() [1/3]

xrpl::STBase::STBase ( )

Definition at line 120 of file STBase.cpp.

◆ STBase() [2/3]

xrpl::STBase::STBase ( STBase const &  )
default

◆ STBase() [3/3]

xrpl::STBase::STBase ( SField const &  n)
explicit

Definition at line 125 of file STBase.cpp.

◆ operator=()

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

Definition at line 123 of file STBase.cpp.

◆ operator==()

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

Definition at line 32 of file STBase.cpp.

◆ operator!=()

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

Definition at line 38 of file STBase.cpp.

◆ downcast() [1/3]

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

Definition at line 193 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
inherited

Definition at line 203 of file STBase.h.

◆ getSType()

SerializedTypeID xrpl::STBase::getSType ( ) const
virtualinherited

◆ getFullText()

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

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

Definition at line 62 of file STBase.cpp.

◆ getText()

std::string xrpl::STBase::getText ( ) const
virtualinherited

◆ getJson()

Json::Value xrpl::STBase::getJson ( JsonOptions  = JsonOptions::none) const
virtualinherited

◆ add()

void xrpl::STBase::add ( Serializer s) const
virtualinherited

◆ isEquivalent()

bool xrpl::STBase::isEquivalent ( STBase const &  t) const
virtualinherited

◆ isDefault()

bool xrpl::STBase::isDefault ( ) const
virtualinherited

◆ setFName()

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

A STBase is a field.

This sets the name.

Definition at line 115 of file STBase.cpp.

◆ getFName()

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

Definition at line 122 of file STBase.cpp.

◆ addFieldID()

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

Definition at line 128 of file STBase.cpp.

◆ emplace()

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

Definition at line 213 of file STBase.h.

◆ copy()

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

◆ move()

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

Member Data Documentation

◆ asset_

std::optional<Asset> xrpl::STTakesAsset::asset_
protected

Definition at line 24 of file STTakesAsset.h.

◆ fName

SField const* xrpl::STBase::fName
privateinherited

Definition at line 116 of file STBase.h.