OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and API documentation
Loading...
Searching...
No Matches
Field Class Reference

#include <OnixS/CME/MDH/messaging/TagBased/Field.h>

Public Member Functions

 Field ()
 operator bool () const noexcept
 operator std::string () const
bool operator== (const StrRef &r) const
bool operator!= (const StrRef &r) const
template<class Value>
ValueConversion< Value >::Result cast () const
bool toStringRef (StrRef &str) const
bool toChar (Char &value) const
bool toNumber (Int8 &value) const
bool toNumber (UInt8 &value) const
bool toNumber (Int16 &value) const
bool toNumber (UInt16 &value) const
bool toNumber (Int32 &value) const
bool toNumber (UInt32 &value) const
bool toNumber (Int64 &value) const
bool toNumber (UInt64 &value) const
bool toNumber (Decimal &value) const
bool toTimestamp (Timestamp &value) const
bool toMaturityMonthYear (MaturityMonthYear &value) const
template<class Enumeration>
bool toEnumeration (typename Enumeration::Enum &value) const
template<class BitSet>
bool toBitSet (BitSet &value) const
std::string toString () const
void toString (std::string &str) const
StrRef toString (Char *buf, size_t size) const

Protected Member Functions

 Field (const ValueConverter &converter) noexcept
const ValueContainervalue () const noexcept
ValueContainervalue () noexcept

Detailed Description

Definition at line 29 of file Field.h.

Constructor & Destructor Documentation

◆ Field() [1/2]

Field ( )
inline

Initializes a field with no value.

Definition at line 33 of file Field.h.

◆ Field() [2/2]

Field ( const ValueConverter & converter)
inlineexplicitprotectednoexcept

Initializes the field.

Definition at line 301 of file Field.h.

Member Function Documentation

◆ cast()

template<class Value>
ValueConversion< Value >::Result cast ( ) const
inline

Casts the stored value to the requested type.

The value may be converted into the value of the requested type if a conversion is possible. Otherwise, an exception is thrown. For example, if the field value represents a reference to a string (e.g. instance of the StrRef class), then it can be successfully converted into a number if the string referred represents a number.

Exceptions
std::runtime_errorif conversion is impossible.

Definition at line 79 of file Field.h.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Tells whether the field has an associated (non-null) value.

Definition at line 41 of file Field.h.

◆ operator std::string()

operator std::string ( ) const
inlineexplicit
Returns
a string presentation.

Definition at line 47 of file Field.h.

◆ operator!=()

bool operator!= ( const StrRef & r) const
inline

Compares the presentation for not equality with given text reference.

Definition at line 63 of file Field.h.

◆ operator==()

bool operator== ( const StrRef & r) const
inline

Compares the presentation for equality with the given text reference.

Definition at line 54 of file Field.h.

◆ toBitSet()

template<class BitSet>
bool toBitSet ( BitSet & value) const
inline

Tries to cast the stored value into a value of the type representing a BitSet.

Returns
false if the conversion fails.

Definition at line 256 of file Field.h.

◆ toChar()

bool toChar ( Char & value) const
inline

Tries to cast the stored value into a value of the Char type.

Returns
false if the conversion fails.

Definition at line 102 of file Field.h.

◆ toEnumeration()

template<class Enumeration>
bool toEnumeration ( typename Enumeration::Enum & value) const
inline

Tries to cast the stored value into a value of the given Enumeration type.

Returns
false if the conversion fails.

Definition at line 235 of file Field.h.

◆ toMaturityMonthYear()

bool toMaturityMonthYear ( MaturityMonthYear & value) const
inline

Tries to cast the stored value into a value of the MaturityMonthYear type.

Returns
false if the conversion fails.

Definition at line 223 of file Field.h.

◆ toNumber() [1/9]

bool toNumber ( Decimal & value) const
inline

Tries to cast the stored value into a value of the Decimal type.

Returns
false if the conversion fails.

Definition at line 201 of file Field.h.

◆ toNumber() [2/9]

bool toNumber ( Int16 & value) const
inline

Tries to cast the stored value into a value of the Int16 type.

Returns
false if the conversion fails.

Definition at line 135 of file Field.h.

◆ toNumber() [3/9]

bool toNumber ( Int32 & value) const
inline

Tries to cast the stored value into a value of the Int32 type.

Returns
false if the conversion fails.

Definition at line 157 of file Field.h.

◆ toNumber() [4/9]

bool toNumber ( Int64 & value) const
inline

Tries to cast the stored value into a value of the Int64 type.

Returns
false if the conversion fails.

Definition at line 179 of file Field.h.

◆ toNumber() [5/9]

bool toNumber ( Int8 & value) const
inline

Tries to cast the stored value into a value of the Int8 type.

Returns
false if the conversion fails.

Definition at line 113 of file Field.h.

◆ toNumber() [6/9]

bool toNumber ( UInt16 & value) const
inline

Tries to cast the stored value into a value of the UInt16 type.

Returns
false if the conversion fails.

Definition at line 146 of file Field.h.

◆ toNumber() [7/9]

bool toNumber ( UInt32 & value) const
inline

Tries to cast the stored value into a value of the UInt32 type.

Returns
false if the conversion fails.

Definition at line 168 of file Field.h.

◆ toNumber() [8/9]

bool toNumber ( UInt64 & value) const
inline

Tries to cast the stored value into a value of the UInt64 type.

Returns
false if the conversion fails.

Definition at line 190 of file Field.h.

◆ toNumber() [9/9]

bool toNumber ( UInt8 & value) const
inline

Tries to cast the stored value into a value of the UInt8 type.

Returns
false if the conversion fails.

Definition at line 124 of file Field.h.

◆ toString() [1/3]

std::string toString ( ) const
inline
Returns
the text representation.

Definition at line 273 of file Field.h.

◆ toString() [2/3]

StrRef toString ( Char * buf,
size_t size ) const
inline
Returns
the text presentation of the value stored in the given container as a StrRef.

Definition at line 292 of file Field.h.

◆ toString() [3/3]

void toString ( std::string & str) const
inline

Outputs the text representation into the given string.

Definition at line 283 of file Field.h.

◆ toStringRef()

bool toStringRef ( StrRef & str) const
inline

Tries to cast the stored value into a value of the StrRef type.

Returns
false if the conversion fails.

Definition at line 91 of file Field.h.

◆ toTimestamp()

bool toTimestamp ( Timestamp & value) const
inline

Tries to cast the stored value into a value of the Timestamp type.

Returns
false if the conversion fails.

Definition at line 212 of file Field.h.

◆ value() [1/2]

const ValueContainer & value ( ) const
inlineprotectednoexcept

Exposes the value storage for further value manipulations.

Definition at line 308 of file Field.h.

◆ value() [2/2]

ValueContainer & value ( )
inlineprotectednoexcept

Exposes the value storage for further value manipulations.

Definition at line 314 of file Field.h.