rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
ripple::TypedField< T > Struct Template Reference

A field with a type known at compile time. More...

#include <SField.h>

Inheritance diagram for ripple::TypedField< T >:
Inheritance graph
[legend]
Collaboration diagram for ripple::TypedField< T >:
Collaboration graph
[legend]

Public Types

using type = T
 
enum  {
  sMD_Never = 0x00 , sMD_ChangeOrig = 0x01 , sMD_ChangeNew = 0x02 , sMD_DeleteFinal = 0x04 ,
  sMD_Create = 0x08 , sMD_Always = 0x10 , sMD_BaseTen = 0x20 , sMD_PseudoAccount = 0x40 ,
  sMD_Default
}
 
enum class  IsSigning : unsigned char { no , yes }
 

Public Member Functions

template<class... Args>
 TypedField (private_access_tag_t pat, Args &&... args)
 
std::string const & getName () const
 
bool hasName () const
 
Json::StaticString const & getJsonName () const
 
 operator Json::StaticString const & () const
 
bool isInvalid () const
 
bool isUseful () const
 
bool isBinary () const
 
bool isDiscardable () const
 
int getCode () const
 
int getNum () const
 
bool shouldMeta (int c) const
 
bool shouldInclude (bool withSigningField) const
 
bool operator== (SField const &f) const
 
bool operator!= (SField const &f) const
 

Static Public Member Functions

static SField const & getField (int fieldCode)
 
static SField const & getField (std::string const &fieldName)
 
static SField const & getField (int type, int value)
 
static SField const & getField (SerializedTypeID type, int value)
 
static int getNumFields ()
 
static int compare (SField const &f1, SField const &f2)
 
static std::unordered_map< int, SField const * > const & getKnownCodeToField ()
 

Public Attributes

int const fieldCode
 
SerializedTypeID const fieldType
 
int const fieldValue
 
std::string const fieldName
 
int const fieldMeta
 
int const fieldNum
 
IsSigning const signingField
 
Json::StaticString const jsonName
 

Static Public Attributes

static IsSigning const notSigning = IsSigning::no
 

Static Private Attributes

static int num = 0
 
static std::unordered_map< int, SField const * > knownCodeToField
 
static std::unordered_map< std::string, SField const * > knownNameToField
 

Detailed Description

template<class T>
struct ripple::TypedField< T >

A field with a type known at compile time.

Definition at line 319 of file SField.h.

Member Typedef Documentation

◆ type

template<class T >
using ripple::TypedField< T >::type = T

Definition at line 321 of file SField.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
sMD_Never 
sMD_ChangeOrig 
sMD_ChangeNew 
sMD_DeleteFinal 
sMD_Create 
sMD_Always 
sMD_BaseTen 
sMD_PseudoAccount 
sMD_Default 

Definition at line 148 of file SField.h.

◆ IsSigning

enum class ripple::SField::IsSigning : unsigned char
stronginherited
Enumerator
no 
yes 

Definition at line 162 of file SField.h.

Constructor & Destructor Documentation

◆ TypedField()

template<class T >
template<class... Args>
ripple::TypedField< T >::TypedField ( private_access_tag_t  pat,
Args &&...  args 
)
explicit

Definition at line 44 of file SField.cpp.

Member Function Documentation

◆ getField() [1/4]

SField const & ripple::SField::getField ( int  fieldCode)
staticinherited

Definition at line 135 of file SField.cpp.

◆ getField() [2/4]

SField const & ripple::SField::getField ( std::string const &  fieldName)
staticinherited

Definition at line 163 of file SField.cpp.

◆ getField() [3/4]

static SField const & ripple::SField::getField ( int  type,
int  value 
)
staticinherited

Definition at line 199 of file SField.h.

◆ getField() [4/4]

static SField const & ripple::SField::getField ( SerializedTypeID  type,
int  value 
)
staticinherited

Definition at line 205 of file SField.h.

◆ getName()

std::string const & ripple::SField::getName ( ) const
inherited

Definition at line 211 of file SField.h.

◆ hasName()

bool ripple::SField::hasName ( ) const
inherited

Definition at line 217 of file SField.h.

◆ getJsonName()

Json::StaticString const & ripple::SField::getJsonName ( ) const
inherited

Definition at line 223 of file SField.h.

◆ operator Json::StaticString const &()

ripple::SField::operator Json::StaticString const & ( ) const
inherited

Definition at line 228 of file SField.h.

◆ isInvalid()

bool ripple::SField::isInvalid ( ) const
inherited

Definition at line 234 of file SField.h.

◆ isUseful()

bool ripple::SField::isUseful ( ) const
inherited

Definition at line 240 of file SField.h.

◆ isBinary()

bool ripple::SField::isBinary ( ) const
inherited

Definition at line 246 of file SField.h.

◆ isDiscardable()

bool ripple::SField::isDiscardable ( ) const
inherited

Definition at line 256 of file SField.h.

◆ getCode()

int ripple::SField::getCode ( ) const
inherited

Definition at line 262 of file SField.h.

◆ getNum()

int ripple::SField::getNum ( ) const
inherited

Definition at line 267 of file SField.h.

◆ getNumFields()

static int ripple::SField::getNumFields ( )
staticinherited

Definition at line 272 of file SField.h.

◆ shouldMeta()

bool ripple::SField::shouldMeta ( int  c) const
inherited

Definition at line 278 of file SField.h.

◆ shouldInclude()

bool ripple::SField::shouldInclude ( bool  withSigningField) const
inherited

Definition at line 284 of file SField.h.

◆ operator==()

bool ripple::SField::operator== ( SField const &  f) const
inherited

Definition at line 291 of file SField.h.

◆ operator!=()

bool ripple::SField::operator!= ( SField const &  f) const
inherited

Definition at line 297 of file SField.h.

◆ compare()

int ripple::SField::compare ( SField const &  f1,
SField const &  f2 
)
staticinherited

Definition at line 147 of file SField.cpp.

◆ getKnownCodeToField()

static std::unordered_map< int, SField const * > const & ripple::SField::getKnownCodeToField ( )
staticinherited

Definition at line 306 of file SField.h.

Member Data Documentation

◆ notSigning

SField::IsSigning const ripple::SField::notSigning = IsSigning::no
staticinherited

Definition at line 163 of file SField.h.

◆ fieldCode

int const ripple::SField::fieldCode
inherited

Definition at line 165 of file SField.h.

◆ fieldType

SerializedTypeID const ripple::SField::fieldType
inherited

Definition at line 166 of file SField.h.

◆ fieldValue

int const ripple::SField::fieldValue
inherited

Definition at line 167 of file SField.h.

◆ fieldName

std::string const ripple::SField::fieldName
inherited

Definition at line 168 of file SField.h.

◆ fieldMeta

int const ripple::SField::fieldMeta
inherited

Definition at line 169 of file SField.h.

◆ fieldNum

int const ripple::SField::fieldNum
inherited

Definition at line 170 of file SField.h.

◆ signingField

IsSigning const ripple::SField::signingField
inherited

Definition at line 171 of file SField.h.

◆ jsonName

Json::StaticString const ripple::SField::jsonName
inherited

Definition at line 172 of file SField.h.

◆ num

int ripple::SField::num = 0
staticprivateinherited

Definition at line 312 of file SField.h.

◆ knownCodeToField

std::unordered_map< int, SField const * > ripple::SField::knownCodeToField
staticprivateinherited

Definition at line 313 of file SField.h.

◆ knownNameToField

std::unordered_map< std::string, SField const * > ripple::SField::knownNameToField
staticprivateinherited

Definition at line 314 of file SField.h.