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

Holds the list of known ledger entry formats. More...

#include <LedgerFormats.h>

Inheritance diagram for xrpl::LedgerFormats:
Collaboration diagram for xrpl::LedgerFormats:

Public Member Functions

LedgerEntryType findTypeByName (std::string const &name) const
 Retrieve the type for a format specified by name.
Item const * findByType (LedgerEntryType 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 LedgerFormats 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, LedgerEntryType type, std::vector< SOElement > uniqueFields, std::vector< SOElement > commonFields={})
 Add a new format.

Private Member Functions

 LedgerFormats ()
 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< LedgerEntryType, Item const * > types_
friend Derived

Detailed Description

Holds the list of known ledger entry formats.

Definition at line 287 of file LedgerFormats.h.

Constructor & Destructor Documentation

◆ LedgerFormats()

xrpl::LedgerFormats::LedgerFormats ( )
private

Create the object.

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

Definition at line 22 of file LedgerFormats.cpp.

Member Function Documentation

◆ getInstance()

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

Definition at line 42 of file LedgerFormats.cpp.

◆ getCommonFields()

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

Definition at line 12 of file LedgerFormats.cpp.

◆ findTypeByName()

LedgerEntryType xrpl::KnownFormats< LedgerEntryType, LedgerFormats >::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< LedgerEntryType, LedgerFormats >::findByType ( LedgerEntryType 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< LedgerEntryType, LedgerFormats >::begin ( ) const
nodiscardinherited

Definition at line 122 of file KnownFormats.h.

◆ end()

Definition at line 128 of file KnownFormats.h.

◆ findByName()

Item const * xrpl::KnownFormats< LedgerEntryType, LedgerFormats >::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< LedgerEntryType, LedgerFormats >::add ( char const * name,
LedgerEntryType 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_

Definition at line 177 of file KnownFormats.h.

◆ formats_

std::forward_list<Item> xrpl::KnownFormats< LedgerEntryType, LedgerFormats >::formats_
privateinherited

Definition at line 182 of file KnownFormats.h.

◆ names_

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

Definition at line 184 of file KnownFormats.h.

◆ types_

boost::container::flat_map<LedgerEntryType, Item const*> xrpl::KnownFormats< LedgerEntryType, LedgerFormats >::types_
privateinherited

Definition at line 185 of file KnownFormats.h.

◆ Derived

Definition at line 186 of file KnownFormats.h.