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

Manages the list of known transaction formats. More...

#include <TxFormats.h>

Inheritance diagram for xrpl::TxFormats:
Collaboration diagram for xrpl::TxFormats:

Public Member Functions

TxType findTypeByName (std::string const &name) const
 Retrieve the type for a format specified by name.
Item const * findByType (TxType type) const
 Retrieve a format based on its type.
std::forward_list< Item >::const_iterator begin () const
std::forward_list< Item >::const_iterator end () const

Static Public Member Functions

static TxFormats const & getInstance ()
static std::vector< SOElement > const & getCommonFields ()

Protected Member Functions

Item const * findByName (std::string const &name) const
 Retrieve a format based on its name.
Item const & add (char const *name, TxType type, std::vector< SOElement > uniqueFields, std::vector< SOElement > commonFields={})
 Add a new format.

Private Member Functions

 TxFormats ()
 Create the object.

Private Attributes

std::string name_
std::forward_list< Item > formats_
boost::container::flat_map< std::string, Item const * > names_
boost::container::flat_map< TxType, Item const * > types_
friend Derived

Detailed Description

Manages the list of known transaction formats.

Definition at line 69 of file TxFormats.h.

Constructor & Destructor Documentation

◆ TxFormats()

xrpl::TxFormats::TxFormats ( )
private

Create the object.

This will load the object with all the known transaction formats.

Definition at line 37 of file TxFormats.cpp.

Member Function Documentation

◆ getInstance()

TxFormats const & xrpl::TxFormats::getInstance ( )
static

Definition at line 57 of file TxFormats.cpp.

◆ getCommonFields()

std::vector< SOElement > const & xrpl::TxFormats::getCommonFields ( )
static

Definition at line 13 of file TxFormats.cpp.

◆ findTypeByName()

TxType xrpl::KnownFormats< TxType, TxFormats >::findTypeByName ( std::string const & name) const
nodiscardinherited

Retrieve the type for a format specified by name.

If the format name is unknown, an exception is thrown.

Parameters
nameThe name of the type.
Returns
The type.

Definition at line 100 of file KnownFormats.h.

◆ findByType()

Item const * xrpl::KnownFormats< TxType, TxFormats >::findByType ( TxType type) const
nodiscardinherited

Retrieve a format based on its type.

Definition at line 112 of file KnownFormats.h.

◆ begin()

std::forward_list< Item >::const_iterator xrpl::KnownFormats< TxType, TxFormats >::begin ( ) const
nodiscardinherited

Definition at line 122 of file KnownFormats.h.

◆ end()

std::forward_list< Item >::const_iterator xrpl::KnownFormats< TxType, TxFormats >::end ( ) const
nodiscardinherited

Definition at line 128 of file KnownFormats.h.

◆ findByName()

Item const * xrpl::KnownFormats< TxType, TxFormats >::findByName ( std::string const & name) const
nodiscardprotectedinherited

Retrieve a format based on its name.

Definition at line 137 of file KnownFormats.h.

◆ add()

Item const & xrpl::KnownFormats< TxType, TxFormats >::add ( char const * name,
TxType type,
std::vector< SOElement > uniqueFields,
std::vector< SOElement > commonFields = {} )
protectedinherited

Add a new format.

Parameters
nameThe name of this format.
typeThe type of this format.
uniqueFieldsA std::vector of unique fields
commonFieldsA std::vector of common fields
Returns
The created format.

Definition at line 155 of file KnownFormats.h.

Member Data Documentation

◆ name_

std::string xrpl::KnownFormats< TxType, TxFormats >::name_
privateinherited

Definition at line 177 of file KnownFormats.h.

◆ formats_

std::forward_list<Item> xrpl::KnownFormats< TxType, TxFormats >::formats_
privateinherited

Definition at line 182 of file KnownFormats.h.

◆ names_

boost::container::flat_map<std::string, Item const*> xrpl::KnownFormats< TxType, TxFormats >::names_
privateinherited

Definition at line 184 of file KnownFormats.h.

◆ types_

boost::container::flat_map<TxType, Item const*> xrpl::KnownFormats< TxType, TxFormats >::types_
privateinherited

Definition at line 185 of file KnownFormats.h.

◆ Derived

friend xrpl::KnownFormats< TxType, TxFormats >::TxFormats
privateinherited

Definition at line 186 of file KnownFormats.h.