rippled
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
ripple::SField Class Reference

Identifies fields. More...

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

Classes

struct  private_access_tag_t
 

Public Types

enum  {
  sMD_Never = 0x00, sMD_ChangeOrig = 0x01, sMD_ChangeNew = 0x02, sMD_DeleteFinal = 0x04,
  sMD_Create = 0x08, sMD_Always = 0x10, sMD_Default
}
 
enum  IsSigning : unsigned char { IsSigning::no, IsSigning::yes }
 

Public Member Functions

 SField (SField const &)=delete
 
SFieldoperator= (SField const &)=delete
 
 SField (SField &&)=delete
 
SFieldoperator= (SField &&)=delete
 
 SField (private_access_tag_t, SerializedTypeID tid, int fv, const char *fn, int meta=sMD_Default, IsSigning signing=IsSigning::yes)
 
 SField (private_access_tag_t, int fc)
 
std::string const & getName () const
 
bool hasName () const
 
Json::StaticString const & getJsonName () 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== (const SField &f) const
 
bool operator!= (const SField &f) const
 

Static Public Member Functions

static const SFieldgetField (int fieldCode)
 
static const SFieldgetField (std::string const &fieldName)
 
static const SFieldgetField (int type, int value)
 
static const SFieldgetField (SerializedTypeID type, int value)
 
static int getNumFields ()
 
static int compare (const SField &f1, const SField &f2)
 

Public Attributes

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

Static Public Attributes

static const IsSigning notSigning = IsSigning::no
 

Static Private Attributes

static int num = 0
 
static std::map< int, SField const * > knownCodeToField
 

Detailed Description

Identifies fields.

Fields are necessary to tag data in signed transactions so that the binary format of the transaction can be canonicalized. All SFields are created at compile time.

Each SField, once constructed, lives until program termination, and there is only one instance per fieldType/fieldValue pair which serves the entire application.

Definition at line 115 of file SField.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
sMD_Never 
sMD_ChangeOrig 
sMD_ChangeNew 
sMD_DeleteFinal 
sMD_Create 
sMD_Always 
sMD_Default 

Definition at line 118 of file SField.h.

◆ IsSigning

enum ripple::SField::IsSigning : unsigned char
strong
Enumerator
no 
yes 

Definition at line 129 of file SField.h.

Constructor & Destructor Documentation

◆ SField() [1/4]

ripple::SField::SField ( SField const &  )
delete

◆ SField() [2/4]

ripple::SField::SField ( SField &&  )
delete

◆ SField() [3/4]

ripple::SField::SField ( private_access_tag_t  ,
SerializedTypeID  tid,
int  fv,
const char *  fn,
int  meta = sMD_Default,
IsSigning  signing = IsSigning::yes 
)

Definition at line 386 of file SField.cpp.

◆ SField() [4/4]

ripple::SField::SField ( private_access_tag_t  ,
int  fc 
)
explicit

Definition at line 405 of file SField.cpp.

Member Function Documentation

◆ operator=() [1/2]

SField& ripple::SField::operator= ( SField const &  )
delete

◆ operator=() [2/2]

SField& ripple::SField::operator= ( SField &&  )
delete

◆ getField() [1/4]

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

Definition at line 418 of file SField.cpp.

◆ getField() [2/4]

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

Definition at line 446 of file SField.cpp.

◆ getField() [3/4]

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

Definition at line 166 of file SField.h.

◆ getField() [4/4]

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

Definition at line 172 of file SField.h.

◆ getName()

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

Definition at line 178 of file SField.h.

◆ hasName()

bool ripple::SField::hasName ( ) const

Definition at line 184 of file SField.h.

◆ getJsonName()

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

Definition at line 190 of file SField.h.

◆ isInvalid()

bool ripple::SField::isInvalid ( ) const

Definition at line 196 of file SField.h.

◆ isUseful()

bool ripple::SField::isUseful ( ) const

Definition at line 202 of file SField.h.

◆ isBinary()

bool ripple::SField::isBinary ( ) const

Definition at line 208 of file SField.h.

◆ isDiscardable()

bool ripple::SField::isDiscardable ( ) const

Definition at line 218 of file SField.h.

◆ getCode()

int ripple::SField::getCode ( ) const

Definition at line 224 of file SField.h.

◆ getNum()

int ripple::SField::getNum ( ) const

Definition at line 229 of file SField.h.

◆ getNumFields()

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

Definition at line 234 of file SField.h.

◆ shouldMeta()

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

Definition at line 240 of file SField.h.

◆ shouldInclude()

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

Definition at line 246 of file SField.h.

◆ operator==()

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

Definition at line 253 of file SField.h.

◆ operator!=()

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

Definition at line 259 of file SField.h.

◆ compare()

int ripple::SField::compare ( const SField f1,
const SField f2 
)
static

Definition at line 430 of file SField.cpp.

Member Data Documentation

◆ notSigning

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

Definition at line 130 of file SField.h.

◆ fieldCode

const int ripple::SField::fieldCode

Definition at line 132 of file SField.h.

◆ fieldType

const SerializedTypeID ripple::SField::fieldType

Definition at line 133 of file SField.h.

◆ fieldValue

const int ripple::SField::fieldValue

Definition at line 134 of file SField.h.

◆ fieldName

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

Definition at line 135 of file SField.h.

◆ fieldMeta

const int ripple::SField::fieldMeta

Definition at line 136 of file SField.h.

◆ fieldNum

const int ripple::SField::fieldNum

Definition at line 137 of file SField.h.

◆ signingField

const IsSigning ripple::SField::signingField

Definition at line 138 of file SField.h.

◆ jsonName

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

Definition at line 139 of file SField.h.

◆ num

int ripple::SField::num = 0
staticprivate

Definition at line 268 of file SField.h.

◆ knownCodeToField

std::map< int, SField const * > ripple::SField::knownCodeToField
staticprivate

Definition at line 269 of file SField.h.