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

#include <STArray.h>

Inheritance diagram for xrpl::STArray:
Collaboration diagram for xrpl::STArray:

Public Types

using value_type = STObject
using size_type = list_type::size_type
using iterator = list_type::iterator
using const_iterator = list_type::const_iterator

Public Member Functions

 STArray ()=default
 STArray (STArray const &)=default
template<class Iter, class = std::enable_if_t< std::is_convertible_v<typename std::iterator_traits<Iter>::reference, STObject>>>
 STArray (Iter first, Iter last)
template<class Iter, class = std::enable_if_t< std::is_convertible_v<typename std::iterator_traits<Iter>::reference, STObject>>>
 STArray (SField const &f, Iter first, Iter last)
STArrayoperator= (STArray const &)=default
 STArray (STArray &&)
STArrayoperator= (STArray &&)
 STArray (SField const &f, std::size_t n)
 STArray (SerialIter &sit, SField const &f, int depth=0)
 STArray (int n)
 STArray (SField const &f)
STObjectoperator[] (std::size_t j)
STObject const & operator[] (std::size_t j) const
STObjectback ()
STObject const & back () const
template<class... Args>
void emplaceBack (Args &&... args)
void pushBack (STObject const &object)
void pushBack (STObject &&object)
void push_back (STObject const &object)
void push_back (STObject &&object)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
size_type size () const
bool empty () const
void clear ()
void reserve (std::size_t n)
void swap (STArray &a) noexcept
std::string getFullText () const override
std::string getText () const override
json::Value getJson (JsonOptions index) const override
void add (Serializer &s) const override
void sort (bool(*compare)(STObject const &o1, STObject const &o2))
bool operator== (STArray const &s) const
bool operator!= (STArray const &s) const
iterator erase (iterator pos)
iterator erase (const_iterator pos)
iterator erase (iterator first, iterator last)
iterator erase (const_iterator first, const_iterator last)
SerializedTypeID getSType () 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
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 STBaseemplace (std::size_t n, void *buf, T &&val)

Private Types

using list_type = std::vector<STObject>

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 auto & getCounter () noexcept

Private Attributes

list_type v_
SField const * fName_

Friends

class detail::STVar

Detailed Description

Definition at line 8 of file STArray.h.

Member Typedef Documentation

◆ list_type

Definition at line 11 of file STArray.h.

◆ value_type

Definition at line 16 of file STArray.h.

◆ size_type

using xrpl::STArray::size_type = list_type::size_type

Definition at line 17 of file STArray.h.

◆ iterator

using xrpl::STArray::iterator = list_type::iterator

Definition at line 18 of file STArray.h.

◆ const_iterator

using xrpl::STArray::const_iterator = list_type::const_iterator

Definition at line 19 of file STArray.h.

Constructor & Destructor Documentation

◆ STArray() [1/9]

xrpl::STArray::STArray ( )
default

◆ STArray() [2/9]

xrpl::STArray::STArray ( STArray const & )
default

◆ STArray() [3/9]

template<class Iter, class>
xrpl::STArray::STArray ( Iter first,
Iter last )
explicit

Definition at line 163 of file STArray.h.

◆ STArray() [4/9]

template<class Iter, class>
xrpl::STArray::STArray ( SField const & f,
Iter first,
Iter last )

Definition at line 168 of file STArray.h.

◆ STArray() [5/9]

xrpl::STArray::STArray ( STArray && other)

Definition at line 18 of file STArray.cpp.

◆ STArray() [6/9]

xrpl::STArray::STArray ( SField const & f,
std::size_t n )

Definition at line 39 of file STArray.cpp.

◆ STArray() [7/9]

xrpl::STArray::STArray ( SerialIter & sit,
SField const & f,
int depth = 0 )

Definition at line 44 of file STArray.cpp.

◆ STArray() [8/9]

xrpl::STArray::STArray ( int n)
explicit

Definition at line 30 of file STArray.cpp.

◆ STArray() [9/9]

xrpl::STArray::STArray ( SField const & f)
explicit

Definition at line 35 of file STArray.cpp.

Member Function Documentation

◆ operator=() [1/2]

STArray & xrpl::STArray::operator= ( STArray const & )
default

◆ operator=() [2/2]

STArray & xrpl::STArray::operator= ( STArray && other)

Definition at line 23 of file STArray.cpp.

◆ operator[]() [1/2]

STObject & xrpl::STArray::operator[] ( std::size_t j)

Definition at line 173 of file STArray.h.

◆ operator[]() [2/2]

STObject const & xrpl::STArray::operator[] ( std::size_t j) const

Definition at line 179 of file STArray.h.

◆ back() [1/2]

STObject & xrpl::STArray::back ( )

Definition at line 185 of file STArray.h.

◆ back() [2/2]

STObject const & xrpl::STArray::back ( ) const
nodiscard

Definition at line 191 of file STArray.h.

◆ emplaceBack()

template<class... Args>
void xrpl::STArray::emplaceBack ( Args &&... args)

Definition at line 198 of file STArray.h.

◆ pushBack() [1/2]

void xrpl::STArray::pushBack ( STObject const & object)

Definition at line 204 of file STArray.h.

◆ pushBack() [2/2]

void xrpl::STArray::pushBack ( STObject && object)

Definition at line 210 of file STArray.h.

◆ push_back() [1/2]

void xrpl::STArray::push_back ( STObject const & object)

Definition at line 72 of file STArray.h.

◆ push_back() [2/2]

void xrpl::STArray::push_back ( STObject && object)

Definition at line 79 of file STArray.h.

◆ begin() [1/2]

STArray::iterator xrpl::STArray::begin ( )

Definition at line 216 of file STArray.h.

◆ end() [1/2]

STArray::iterator xrpl::STArray::end ( )

Definition at line 222 of file STArray.h.

◆ begin() [2/2]

STArray::const_iterator xrpl::STArray::begin ( ) const
nodiscard

Definition at line 228 of file STArray.h.

◆ end() [2/2]

STArray::const_iterator xrpl::STArray::end ( ) const
nodiscard

Definition at line 234 of file STArray.h.

◆ size()

STArray::size_type xrpl::STArray::size ( ) const
nodiscard

Definition at line 240 of file STArray.h.

◆ empty()

bool xrpl::STArray::empty ( ) const
nodiscard

Definition at line 246 of file STArray.h.

◆ clear()

void xrpl::STArray::clear ( )

Definition at line 252 of file STArray.h.

◆ reserve()

void xrpl::STArray::reserve ( std::size_t n)

Definition at line 258 of file STArray.h.

◆ swap()

void xrpl::STArray::swap ( STArray & a)
noexcept

Definition at line 264 of file STArray.h.

◆ getFullText()

std::string xrpl::STArray::getFullText ( ) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 93 of file STArray.cpp.

◆ getText()

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

Reimplemented from xrpl::STBase.

Definition at line 112 of file STArray.cpp.

◆ getJson()

json::Value xrpl::STArray::getJson ( JsonOptions index) const
nodiscardoverridevirtual

Reimplemented from xrpl::STBase.

Definition at line 131 of file STArray.cpp.

◆ add()

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

Reimplemented from xrpl::STBase.

Definition at line 146 of file STArray.cpp.

◆ sort()

void xrpl::STArray::sort ( bool(* compare )(STObject const &o1, STObject const &o2))

Definition at line 176 of file STArray.cpp.

◆ operator==() [1/2]

bool xrpl::STArray::operator== ( STArray const & s) const

Definition at line 270 of file STArray.h.

◆ operator!=() [1/2]

bool xrpl::STArray::operator!= ( STArray const & s) const

Definition at line 276 of file STArray.h.

◆ erase() [1/4]

STArray::iterator xrpl::STArray::erase ( iterator pos)

Definition at line 282 of file STArray.h.

◆ erase() [2/4]

STArray::iterator xrpl::STArray::erase ( const_iterator pos)

Definition at line 288 of file STArray.h.

◆ erase() [3/4]

STArray::iterator xrpl::STArray::erase ( iterator first,
iterator last )

Definition at line 294 of file STArray.h.

◆ erase() [4/4]

STArray::iterator xrpl::STArray::erase ( const_iterator first,
const_iterator last )

Definition at line 300 of file STArray.h.

◆ getSType()

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

Reimplemented from xrpl::STBase.

Definition at line 157 of file STArray.cpp.

◆ isEquivalent()

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

Reimplemented from xrpl::STBase.

Definition at line 163 of file STArray.cpp.

◆ isDefault()

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

Reimplemented from xrpl::STBase.

Definition at line 170 of file STArray.cpp.

◆ copy()

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

Reimplemented from xrpl::STBase.

Definition at line 81 of file STArray.cpp.

◆ move()

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

Reimplemented from xrpl::STBase.

Definition at line 87 of file STArray.cpp.

◆ operator==() [2/2]

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

Definition at line 36 of file STBase.cpp.

◆ operator!=() [2/2]

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.

◆ 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.

◆ getCounter()

auto & xrpl::CountedObject< STArray >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

◆ detail::STVar

friend class detail::STVar
friend

Definition at line 159 of file STArray.h.

Member Data Documentation

◆ v_

list_type xrpl::STArray::v_
private

Definition at line 13 of file STArray.h.

◆ fName_

SField const* xrpl::STBase::fName_
privateinherited

Definition at line 118 of file STBase.h.

◆ Object

Definition at line 134 of file CountedObject.h.