OnixS C++ CME Streamlined Market Data Handler
API documentation
Decimal Class Reference

#include <Decimal.h>

Public Types

enum  { Size = sizeof(Mantissa) + sizeof(Exponent) }
typedef DecimalMantissa Mantissa
typedef DecimalExponent Exponent

Public Member Functions

 Decimal ()
 Decimal (DecimalMantissa mantissa, DecimalExponent exponent)
 Decimal (const Decimal &other)
DecimalMantissa mantissa () const
DecimalExponent exponent () const
bool operator== (const Decimal &) const
bool operator!= (const Decimal &) const
 operator Double () const
bool toNumber (Double &) const
Decimaloperator= (const Decimal &other)

Detailed Description

Definition at line 45 of file Decimal.h.

Member Typedef Documentation

Aliases exponent component type.

Definition at line 52 of file Decimal.h.

Aliases mantissa component type.

Definition at line 49 of file Decimal.h.

Member Enumeration Documentation

anonymous enum

A few traits.


Size of class in bytes.

    Instantiations of given class are used
    while manipulating binary messages. Regular
    composites expose given characteristics so
    as this template class does.  

Definition at line 55 of file Decimal.h.

Constructor & Destructor Documentation

Decimal ( )

Default constructor. Initializes the decimal value to zero.

Definition at line 127 of file Decimal.h.

Decimal ( DecimalMantissa  mantissa,
DecimalExponent  exponent 

Initializes instance from compound components.

Decimal ( const Decimal other)

Initializes as copy of given value.

Member Function Documentation

DecimalExponent exponent ( ) const

Returns exponent part of decimal.

Definition at line 138 of file Decimal.h.

DecimalMantissa mantissa ( ) const

Returns mantissa part of decimal.

Definition at line 133 of file Decimal.h.

operator Double ( ) const

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

domain_errorexception on failure.

Definition at line 143 of file Decimal.h.

bool operator!= ( const Decimal ) const

Compares two numbers.

Decimal& operator= ( const Decimal other)

Reinitializes instance from another one.

bool operator== ( const Decimal ) const

Compares two numbers.

bool toNumber ( Double ) const

Casts to floating point number.

false if conversion fails.

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