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

Defines the fields and their attributes within a STObject. More...

#include <SOTemplate.h>

Collaboration diagram for xrpl::SOTemplate:

Public Member Functions

 SOTemplate (SOTemplate &&other)=default
SOTemplateoperator= (SOTemplate &&other)=default
 SOTemplate (std::vector< SOElement > uniqueFields, std::vector< SOElement > commonFields={})
 Create a template populated with all fields.
 SOTemplate (std::initializer_list< SOElement > uniqueFields, std::initializer_list< SOElement > commonFields={})
 Create a template populated with all fields.
std::vector< SOElement >::const_iterator begin () const
std::vector< SOElement >::const_iterator cbegin () const
std::vector< SOElement >::const_iterator end () const
std::vector< SOElement >::const_iterator cend () const
std::size_t size () const
 The number of entries in this template.
int getIndex (SField const &) const
 Retrieve the position of a named field.
SOEStyle style (SField const &sf) const

Private Attributes

std::vector< SOElementelements_
std::vector< int > indices_

Detailed Description

Defines the fields and their attributes within a STObject.

Each subclass of SerializedObject will provide its own template describing the available fields and their metadata attributes.

Definition at line 95 of file SOTemplate.h.

Constructor & Destructor Documentation

◆ SOTemplate() [1/3]

xrpl::SOTemplate::SOTemplate ( SOTemplate && other)
default

◆ SOTemplate() [2/3]

xrpl::SOTemplate::SOTemplate ( std::vector< SOElement > uniqueFields,
std::vector< SOElement > commonFields = {} )

Create a template populated with all fields.

After creating the template fields cannot be added, modified, or removed.

Definition at line 23 of file SOTemplate.cpp.

◆ SOTemplate() [3/3]

xrpl::SOTemplate::SOTemplate ( std::initializer_list< SOElement > uniqueFields,
std::initializer_list< SOElement > commonFields = {} )

Create a template populated with all fields.

Note: Defers to the vector constructor above.

Definition at line 16 of file SOTemplate.cpp.

Member Function Documentation

◆ operator=()

SOTemplate & xrpl::SOTemplate::operator= ( SOTemplate && other)
default

◆ begin()

std::vector< SOElement >::const_iterator xrpl::SOTemplate::begin ( ) const
nodiscard

Definition at line 118 of file SOTemplate.h.

◆ cbegin()

std::vector< SOElement >::const_iterator xrpl::SOTemplate::cbegin ( ) const
nodiscard

Definition at line 124 of file SOTemplate.h.

◆ end()

std::vector< SOElement >::const_iterator xrpl::SOTemplate::end ( ) const
nodiscard

Definition at line 130 of file SOTemplate.h.

◆ cend()

std::vector< SOElement >::const_iterator xrpl::SOTemplate::cend ( ) const
nodiscard

Definition at line 136 of file SOTemplate.h.

◆ size()

std::size_t xrpl::SOTemplate::size ( ) const
nodiscard

The number of entries in this template.

Definition at line 143 of file SOTemplate.h.

◆ getIndex()

int xrpl::SOTemplate::getIndex ( SField const & sField) const
nodiscard

Retrieve the position of a named field.

Definition at line 54 of file SOTemplate.cpp.

◆ style()

SOEStyle xrpl::SOTemplate::style ( SField const & sf) const
nodiscard

Definition at line 153 of file SOTemplate.h.

Member Data Documentation

◆ elements_

std::vector<SOElement> xrpl::SOTemplate::elements_
private

Definition at line 159 of file SOTemplate.h.

◆ indices_

std::vector<int> xrpl::SOTemplate::indices_
private

Definition at line 160 of file SOTemplate.h.