OnixS C++ FIX Engine  4.12.0
API Documentation
Decimal Class Reference

#include <OnixS/FIXEngine/FIX/Numeric.h>

Public Member Functions

 Decimal (DecimalMantissa mantissa=0, DecimalExponent exponent=0)
 
 Decimal (Double value, size_t precision=17)
 
DecimalMantissa mantissa () const
 
void mantissa (DecimalMantissa)
 
DecimalExponent exponent () const
 
void exponent (DecimalExponent)
 
bool operator== (const Decimal &) const
 
bool operator!= (const Decimal &) const
 
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
 

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 47 of file Numeric.h.

Constructor & Destructor Documentation

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

Initializes an instance from compound components.

Definition at line 168 of file Numeric.h.

Decimal ( Double  value,
size_t  precision = 17 
)
explicit

Converts the Double value to a decimal.

Parameters
valueThe double precision floating-point value.
precisionDefines the conversion precision.

Member Function Documentation

DecimalExponent exponent ( ) const
inline

Returns the exponent part of the decimal.

Definition at line 193 of file Numeric.h.

void exponent ( DecimalExponent  value)
inline

Updates the exponent part of the decimal.

Definition at line 200 of file Numeric.h.

DecimalMantissa mantissa ( ) const
inline

Returns the mantissa part of the decimal.

Definition at line 178 of file Numeric.h.

void mantissa ( DecimalMantissa  value)
inline

Updates the mantissa part of the decimal.

Definition at line 185 of file Numeric.h.

operator Double ( ) const
inline

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

Exceptions
Thedomain_error exception on a failure.

Definition at line 255 of file Numeric.h.

operator Int32 ( ) const
inline

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

Exceptions
Thedomain_error exception on a failure.

Definition at line 207 of file Numeric.h.

operator Int64 ( ) const
inline

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

Exceptions
Thedomain_error exception on a failure.

Definition at line 231 of file Numeric.h.

operator UInt32 ( ) const
inline

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

Exceptions
Thedomain_error exception on a failure.

Definition at line 219 of file Numeric.h.

operator UInt64 ( ) const
inline

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

Exceptions
Thedomain_error exception on a failure.

Definition at line 243 of file Numeric.h.

bool operator!= ( const Decimal ) const

Compares two numbers.

bool operator< ( const Decimal ) const

Compares two numbers.

bool operator== ( const Decimal ) const

Compares two numbers.

bool operator> ( const Decimal ) const

Compares two numbers.

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

Parses the decimal from the string presentation.

Exceptions
Thestd::exception on a failure.
bool toNumber ( Int32 ) const

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

Returns
false if the conversion fails.
bool toNumber ( UInt32 ) const

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

Returns
false if the conversion fails.
bool toNumber ( Int64 ) const

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

Returns
false if the conversion fails.
bool toNumber ( UInt64 ) const

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

Returns
false if the conversion fails.
bool toNumber ( Double ) const

Casts to the floating point number.

Returns
false if the conversion fails.
void toString ( std::string &  ) const

Appends the text presentation to the given string.

std::string toString ( ) const
inline

Returns the text presentation of the decimal.

Definition at line 268 of file Numeric.h.

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

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

Returns
false on the parsing failure.

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