xrpld
Loading...
Searching...
No Matches
xrpl::TypedField< T > Struct Template Reference

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

#include <SField.h>

Inheritance diagram for xrpl::TypedField< T >:
Collaboration diagram for xrpl::TypedField< T >:

Public Types

using type = T
enum class  IsSigning : unsigned char { No , Yes }

Public Member Functions

template<class... Args>
 TypedField (PrivateAccessTagT 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 fieldCodeMem
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 constexpr auto kSmdNever = 0x00
static constexpr auto kSmdChangeOrig = 0x01
static constexpr auto kSmdChangeNew = 0x02
static constexpr auto kSmdDeleteFinal = 0x04
static constexpr auto kSmdCreate = 0x08
static constexpr auto kSmdAlways = 0x10
static constexpr auto kSmdBaseTen = 0x20
static constexpr auto kSmdPseudoAccount = 0x40
static constexpr auto kSmdNeedsAsset = 0x80
static constexpr auto kSmdDefault
static IsSigning const kNotSigning = 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 xrpl::TypedField< T >

A field with a type known at compile time.

Definition at line 303 of file SField.h.

Member Typedef Documentation

◆ type

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

Definition at line 305 of file SField.h.

Member Enumeration Documentation

◆ IsSigning

enum class xrpl::SField::IsSigning : unsigned char
stronginherited
Enumerator
No 
Yes 

Definition at line 147 of file SField.h.

Constructor & Destructor Documentation

◆ TypedField()

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

Definition at line 26 of file SField.cpp.

Member Function Documentation

◆ getField() [1/4]

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

Definition at line 116 of file SField.cpp.

◆ getField() [2/4]

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

Definition at line 144 of file SField.cpp.

◆ getField() [3/4]

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

Definition at line 184 of file SField.h.

◆ getField() [4/4]

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

Definition at line 190 of file SField.h.

◆ getName()

std::string const & xrpl::SField::getName ( ) const
nodiscardinherited

Definition at line 196 of file SField.h.

◆ hasName()

bool xrpl::SField::hasName ( ) const
nodiscardinherited

Definition at line 202 of file SField.h.

◆ getJsonName()

json::StaticString const & xrpl::SField::getJsonName ( ) const
nodiscardinherited

Definition at line 208 of file SField.h.

◆ operator json::StaticString const &()

xrpl::SField::operator json::StaticString const & ( ) const
inherited

Definition at line 213 of file SField.h.

◆ isInvalid()

bool xrpl::SField::isInvalid ( ) const
nodiscardinherited

Definition at line 219 of file SField.h.

◆ isUseful()

bool xrpl::SField::isUseful ( ) const
nodiscardinherited

Definition at line 225 of file SField.h.

◆ isBinary()

bool xrpl::SField::isBinary ( ) const
nodiscardinherited

Definition at line 231 of file SField.h.

◆ isDiscardable()

bool xrpl::SField::isDiscardable ( ) const
nodiscardinherited

Definition at line 241 of file SField.h.

◆ getCode()

int xrpl::SField::getCode ( ) const
nodiscardinherited

Definition at line 247 of file SField.h.

◆ getNum()

int xrpl::SField::getNum ( ) const
nodiscardinherited

Definition at line 252 of file SField.h.

◆ getNumFields()

int xrpl::SField::getNumFields ( )
staticinherited

Definition at line 257 of file SField.h.

◆ shouldMeta()

bool xrpl::SField::shouldMeta ( int c) const
nodiscardinherited

Definition at line 263 of file SField.h.

◆ shouldInclude()

bool xrpl::SField::shouldInclude ( bool withSigningField) const
nodiscardinherited

Definition at line 269 of file SField.h.

◆ operator==()

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

Definition at line 275 of file SField.h.

◆ operator!=()

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

Definition at line 281 of file SField.h.

◆ compare()

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

Definition at line 128 of file SField.cpp.

◆ getKnownCodeToField()

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

Definition at line 290 of file SField.h.

Member Data Documentation

◆ kSmdNever

auto xrpl::SField::kSmdNever = 0x00
staticconstexprinherited

Definition at line 132 of file SField.h.

◆ kSmdChangeOrig

auto xrpl::SField::kSmdChangeOrig = 0x01
staticconstexprinherited

Definition at line 133 of file SField.h.

◆ kSmdChangeNew

auto xrpl::SField::kSmdChangeNew = 0x02
staticconstexprinherited

Definition at line 134 of file SField.h.

◆ kSmdDeleteFinal

auto xrpl::SField::kSmdDeleteFinal = 0x04
staticconstexprinherited

Definition at line 135 of file SField.h.

◆ kSmdCreate

auto xrpl::SField::kSmdCreate = 0x08
staticconstexprinherited

Definition at line 136 of file SField.h.

◆ kSmdAlways

auto xrpl::SField::kSmdAlways = 0x10
staticconstexprinherited

Definition at line 137 of file SField.h.

◆ kSmdBaseTen

auto xrpl::SField::kSmdBaseTen = 0x20
staticconstexprinherited

Definition at line 138 of file SField.h.

◆ kSmdPseudoAccount

auto xrpl::SField::kSmdPseudoAccount = 0x40
staticconstexprinherited

Definition at line 139 of file SField.h.

◆ kSmdNeedsAsset

auto xrpl::SField::kSmdNeedsAsset = 0x80
staticconstexprinherited

Definition at line 141 of file SField.h.

◆ kSmdDefault

auto xrpl::SField::kSmdDefault
staticconstexprinherited
Initial value:
=
static constexpr auto kSmdChangeOrig
Definition SField.h:133
static constexpr auto kSmdDeleteFinal
Definition SField.h:135
static constexpr auto kSmdCreate
Definition SField.h:136
static constexpr auto kSmdChangeNew
Definition SField.h:134

Definition at line 144 of file SField.h.

◆ kNotSigning

SField::IsSigning const xrpl::SField::kNotSigning = IsSigning::No
staticinherited

Definition at line 148 of file SField.h.

◆ fieldCodeMem

int const xrpl::SField::fieldCodeMem
inherited

Definition at line 150 of file SField.h.

◆ fieldType

SerializedTypeID const xrpl::SField::fieldType
inherited

Definition at line 151 of file SField.h.

◆ fieldValue

int const xrpl::SField::fieldValue
inherited

Definition at line 152 of file SField.h.

◆ fieldName

std::string const xrpl::SField::fieldName
inherited

Definition at line 153 of file SField.h.

◆ fieldMeta

int const xrpl::SField::fieldMeta
inherited

Definition at line 154 of file SField.h.

◆ fieldNum

int const xrpl::SField::fieldNum
inherited

Definition at line 155 of file SField.h.

◆ signingField

IsSigning const xrpl::SField::signingField
inherited

Definition at line 156 of file SField.h.

◆ jsonName

json::StaticString const xrpl::SField::jsonName
inherited

Definition at line 157 of file SField.h.

◆ num

int xrpl::SField::num = 0
staticprivateinherited

Definition at line 296 of file SField.h.

◆ knownCodeToField

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

Definition at line 297 of file SField.h.

◆ knownNameToField

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

Definition at line 298 of file SField.h.