OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
Decimal Class Reference

#include <OnixS/Eurex/MarketData/Numeric.h>

Public Member Functions

 Decimal (DecimalMantissa mantissa=0, DecimalExponent exponent=0)
 
 Decimal (int)
 
 Decimal (Double value)
 
 Decimal (Double value, size_t precision)
 
 Decimal (const Decimal &other)
 
DecimalMantissa mantissa () const
 
void mantissa (DecimalMantissa)
 
DecimalExponent exponent () const
 
void exponent (DecimalExponent)
 
bool operator== (const Decimal &) const
 
bool operator!= (const Decimal &) const
 
 operator Int32 () const
 
 operator UInt32 () const
 
 operator Int64 () const
 
 operator UInt64 () const
 
 operator Double () const
 
bool toNumber (Int32 &) const
 
bool toNumber (UInt32 &) const
 
bool toNumber (Int64 &) const
 
bool toNumber (UInt64 &) const
 
bool toNumber (Double &) const
 
void toString (std::string &) const
 
std::string toString () const
 
Decimaloperator= (const Decimal &other)
 

Static Public Member Functions

static bool tryParse (const char *buffer, size_t bufferSize, Decimal &)
 
static Decimal parse (const char *buffer, size_t bufferSize)
 

Detailed Description

Definition at line 63 of file Numeric.h.

Constructor & Destructor Documentation

Decimal ( DecimalMantissa  mantissa = 0,
DecimalExponent  exponent = 0 
)

Initializes instance from compound components.

Definition at line 33 of file Decimal.cpp.

Decimal ( int  value)
explicit

Definition at line 41 of file Decimal.cpp.

Decimal ( Double  value)
explicit

Converts from Double value using default conversion precision.

Definition at line 58 of file Decimal.cpp.

Decimal ( Double  value,
size_t  precision 
)

Converts Double value to decimal.

Parameters
valuedouble precision floating-point value.
precisiondefines conversion precision.

Definition at line 75 of file Decimal.cpp.

Decimal ( const Decimal other)

Initializes as copy of given value.

Definition at line 93 of file Decimal.cpp.

Member Function Documentation

DecimalExponent exponent ( ) const
inline

Returns exponent part of decimal.

Definition at line 214 of file Numeric.h.

void exponent ( DecimalExponent  value)
inline

Updates exponent part of decimal.

Definition at line 221 of file Numeric.h.

DecimalMantissa mantissa ( ) const
inline

Returns mantissa part of decimal.

Definition at line 199 of file Numeric.h.

void mantissa ( DecimalMantissa  value)
inline

Updates mantissa part of decimal.

Definition at line 206 of file Numeric.h.

operator Double ( ) const
inline

Casts to whole floating point as regular value is casted to a smaller precision.

Exceptions
domain_errorexception on failure.

Definition at line 276 of file Numeric.h.

operator Int32 ( ) const
inline

Casts to whole integer number as regular floating point value is casted.

Exceptions
domain_errorexception on failure.

Definition at line 228 of file Numeric.h.

operator Int64 ( ) const
inline

Casts to whole integer number as regular floating point value is casted.

Exceptions
domain_errorexception on failure.

Definition at line 252 of file Numeric.h.

operator UInt32 ( ) const
inline

Casts to whole integer number as regular floating point value is casted.

Exceptions
domain_errorexception on failure.

Definition at line 240 of file Numeric.h.

operator UInt64 ( ) const
inline

Casts to whole integer number as regular floating point value is casted.

Exceptions
domain_errorexception on failure.

Definition at line 264 of file Numeric.h.

bool operator!= ( const Decimal other) const

Compares two numbers.

Definition at line 113 of file Decimal.cpp.

Decimal & operator= ( const Decimal other)

Reinitializes instance from another one.

Definition at line 145 of file Decimal.cpp.

bool operator== ( const Decimal other) const

Compares two numbers.

Definition at line 101 of file Decimal.cpp.

Decimal parse ( const char *  buffer,
size_t  bufferSize 
)
static

Parses decimal from string presentation.

Exceptions
std::exceptionon failure.

Definition at line 251 of file Decimal.cpp.

bool toNumber ( Int32 number) const

Casts to whole integer number as regular floating point value is casted.

Returns
false if conversion fails.

Definition at line 154 of file Decimal.cpp.

bool toNumber ( UInt32 number) const

Casts to whole integer number as regular floating point value is casted.

Returns
false if conversion fails.

Definition at line 163 of file Decimal.cpp.

bool toNumber ( Int64 &  number) const

Casts to whole integer number as regular floating point value is casted.

Returns
false if conversion fails.

Definition at line 172 of file Decimal.cpp.

bool toNumber ( UInt64 &  number) const

Casts to whole integer number as regular floating point value is casted.

Returns
false if conversion fails.

Definition at line 190 of file Decimal.cpp.

bool toNumber ( Double number) const

Casts to floating point number.

Returns
false if conversion fails.

Definition at line 208 of file Decimal.cpp.

void toString ( std::string &  str) const

Appends text presentation to given string.

Definition at line 217 of file Decimal.cpp.

std::string toString ( ) const
inline

Returns text presentation of decimal.

Definition at line 289 of file Numeric.h.

bool tryParse ( const char *  buffer,
size_t  bufferSize,
Decimal value 
)
static

Attempts to parse decimal value from its string/text presentation.

Returns
false on parsing failure.

Definition at line 225 of file Decimal.cpp.


The documentation for this class was generated from the following files: