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

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

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

Public Member Functions

TxType findTypeByName (std::string const &name) const
 Retrieve the type for a format specified by name. More...
 
Item const * findByType (TxType type) const
 Retrieve a format based on its type. More...
 

Static Public Member Functions

static TxFormats 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, TxType type, std::initializer_list< SOElement > uniqueFields, std::initializer_list< SOElement > commonFields={})
 Add a new format. More...
 

Private Member Functions

 TxFormats ()
 Create the object. More...
 

Private Attributes

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

Detailed Description

Manages the list of known transaction formats.

Definition at line 65 of file TxFormats.h.

Constructor & Destructor Documentation

◆ TxFormats()

ripple::TxFormats::TxFormats ( )
private

Create the object.

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

Definition at line 25 of file TxFormats.cpp.

Member Function Documentation

◆ getInstance()

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

Definition at line 257 of file TxFormats.cpp.

◆ findTypeByName()

TxType ripple::KnownFormats< TxType >::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 112 of file KnownFormats.h.

◆ findByType()

Item const* ripple::KnownFormats< TxType >::findByType ( TxType  type) const
inherited

Retrieve a format based on its type.

Definition at line 125 of file KnownFormats.h.

◆ findByName()

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

Retrieve a format based on its name.

Definition at line 137 of file KnownFormats.h.

◆ add()

Item const& ripple::KnownFormats< TxType >::add ( char const *  name,
TxType  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 155 of file KnownFormats.h.

Member Data Documentation

◆ formats_

std::forward_list<Item> ripple::KnownFormats< TxType >::formats_
privateinherited

Definition at line 173 of file KnownFormats.h.

◆ names_

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

Definition at line 175 of file KnownFormats.h.

◆ types_

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

Definition at line 176 of file KnownFormats.h.