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

A type which can be exported to a well known binary format. More...

#include <STBase.h>

Inheritance diagram for xrpl::STBase:
Collaboration diagram for xrpl::STBase:

Public Member Functions

virtual ~STBase ()=default
 STBase ()
 STBase (STBase const &)=default
STBaseoperator= (STBase const &t)
 STBase (SField const &n)
bool operator== (STBase const &t) const
bool operator!= (STBase const &t) const
template<class D>
D & downcast ()
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::Values::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
template<class D>
D const & downcast () const

Static Protected Member Functions

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

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_

Friends

class detail::STVar

Detailed Description

A type which can be exported to a well known binary format.

A STBase:

  • Always a field
  • Can always go inside an eligible enclosing STBase (such as STArray)
  • Has a field name

Like JSON, a SerializedObject is a basket which has rules on what it can hold.

Note
"ST" stands for "Serialized Type."

Definition at line 116 of file STBase.h.

Constructor & Destructor Documentation

◆ ~STBase()

virtual xrpl::STBase::~STBase ( )
virtualdefault

◆ STBase() [1/3]

xrpl::STBase::STBase ( )

Definition at line 15 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 19 of file STBase.cpp.

Member Function Documentation

◆ operator=()

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

Definition at line 25 of file STBase.cpp.

◆ operator==()

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

Definition at line 36 of file STBase.cpp.

◆ operator!=()

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

Definition at line 42 of file STBase.cpp.

◆ downcast() [1/3]

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

Definition at line 195 of file STBase.h.

◆ downcast() [2/3]

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

◆ getSType()

◆ getFullText()

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

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

Definition at line 66 of file STBase.cpp.

◆ getText()

◆ getJson()

◆ add()

◆ isEquivalent()

◆ isDefault()

◆ setFName()

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

A STBase is a field.

This sets the name.

Definition at line 119 of file STBase.cpp.

◆ getFName()

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

Definition at line 126 of file STBase.cpp.

◆ addFieldID()

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

Definition at line 132 of file STBase.cpp.

◆ emplace()

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

Definition at line 215 of file STBase.h.

◆ copy()

◆ move()

◆ downcast() [3/3]

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

Definition at line 205 of file STBase.h.

◆ detail::STVar

friend class detail::STVar
friend

Definition at line 185 of file STBase.h.

Member Data Documentation

◆ fName_

SField const* xrpl::STBase::fName_
private

Definition at line 118 of file STBase.h.