rippled
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ripple::LedgerFormats Class Reference

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

Inheritance diagram for ripple::LedgerFormats:
Inheritance graph
[legend]
Collaboration diagram for ripple::LedgerFormats:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

static LedgerFormats const & getInstance ()
 

Protected Member Functions

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

Private Member Functions

 LedgerFormats ()
 Create the object. More...
 

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_
 

Detailed Description

Holds the list of known ledger entry formats.

Definition at line 276 of file LedgerFormats.h.

Constructor & Destructor Documentation

◆ LedgerFormats()

ripple::LedgerFormats::LedgerFormats ( )
private

Create the object.

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

Definition at line 26 of file LedgerFormats.cpp.

Member Function Documentation

◆ getInstance()

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

Definition at line 274 of file LedgerFormats.cpp.

◆ findTypeByName()

LedgerEntryType ripple::KnownFormats< LedgerEntryType , LedgerFormats >::findTypeByName ( std::string const &  name) const
inherited

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 115 of file KnownFormats.h.

◆ findByType()

Item const* ripple::KnownFormats< LedgerEntryType , LedgerFormats >::findByType ( LedgerEntryType  type) const
inherited

Retrieve a format based on its type.

Definition at line 127 of file KnownFormats.h.

◆ begin()

Definition at line 137 of file KnownFormats.h.

◆ end()

Definition at line 143 of file KnownFormats.h.

◆ findByName()

Item const* ripple::KnownFormats< LedgerEntryType , LedgerFormats >::findByName ( std::string const &  name) const
protectedinherited

Retrieve a format based on its name.

Definition at line 152 of file KnownFormats.h.

◆ add()

Item const& ripple::KnownFormats< LedgerEntryType , LedgerFormats >::add ( char const *  name,
LedgerEntryType  type,
std::initializer_list< SOElement uniqueFields,
std::initializer_list< SOElement commonFields = {} 
)
protectedinherited

Add a new format.

Parameters
nameThe name of this format.
typeThe type of this format.
uniqueFieldsAn std::initializer_list of unique fields
commonFieldsAn std::initializer_list of common fields
Returns
The created format.

Definition at line 170 of file KnownFormats.h.

Member Data Documentation

◆ name_

Definition at line 192 of file KnownFormats.h.

◆ formats_

Definition at line 197 of file KnownFormats.h.

◆ names_

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

Definition at line 199 of file KnownFormats.h.

◆ types_

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

Definition at line 200 of file KnownFormats.h.