B2BITS FIX Antenna HFT
1.0.16
|
Encapsulates float type. More...
#include <B2BITS_Decimal.h>
Public Member Functions | |
Decimal | changeExponent (System::i32 newExponent) const throw () |
Returns new Decimal value with required exponent. More... | |
Decimal () throw () | |
Default contructor. More... | |
Decimal (System::i64 m, System::i32 e) throw () | |
Contructor Constructs object from mantissa and exponent. More... | |
Decimal (double v) throw () | |
Contructor Constructs object from double. More... | |
Decimal (System::i64 x) throw () | |
Contructor Constructs object from 64-bit integer. More... | |
bool | equals (const Decimal &rv) const throw () |
Compares two Decimals. More... | |
System::i32 | getExponent () const throw () |
Returns exponent part of the value. More... | |
System::i64 | getMantissa () const throw () |
Returns mantissa part of the value. More... | |
bool | operator!= (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
bool | operator< (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
bool | operator<= (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
bool | operator== (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
bool | operator> (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
bool | operator>= (Engine::Decimal const &val) const throw () |
Compares two decimals. More... | |
double | toDouble () const throw () |
Converts stored value to double. More... | |
float | toFloat () const throw () |
Converts stored value to float. More... | |
std::string | toStdString () const |
Converts decimal to FIX string. More... | |
char * | toString (char *buf) const throw () |
Converts decimal to FIX string. More... | |
char * | toString (char *buf, std::size_t size) const throw () |
If result string is less than passed buffer, remain chars will be filled with zeros according to FIX protocol. More... | |
Static Public Member Functions | |
static Decimal | fromDouble (double v, int precision) throw () |
Contructor Constructs object from double. More... | |
static Decimal | fromDouble (double v) throw () |
Contructor Constructs object from double. More... | |
static Decimal | fromFixString (AsciiString str) throw () |
Converts string to Decimal. More... | |
static Decimal | fromString (AsciiString str) throw () |
Converts string to Decimal. More... | |
static Decimal | fromString (WideString str) throw () |
Converts wide-string to Decimal. More... | |
Static Public Attributes | |
static unsigned int const | ValueSize = 2 + 63 + sizeof( "18446744073709551616" ) |
Maximum buffer size required to store value. More... | |
Encapsulates float type.
Engine::Decimal::Decimal | ( | ) | ||
throw | ( | |||
) |
Default contructor.
Engine::Decimal::Decimal | ( | System::i64 | m, |
System::i32 | e | ||
) | |||
throw | ( | ||
) |
Contructor Constructs object from mantissa and exponent.
m | Mantissa |
e | Exponent |
Engine::Decimal::Decimal | ( | double | v | ) | |
throw | ( | ||||
) |
Contructor Constructs object from double.
v | Value of the double type |
Engine::Decimal::Decimal | ( | System::i64 | x | ) | |
throw | ( | ||||
) |
Contructor Constructs object from 64-bit integer.
x | Value of the i64 type |
Decimal Engine::Decimal::changeExponent | ( | System::i32 | newExponent | ) | const |
throw | ( | ||||
) |
Returns new Decimal value with required exponent.
bool Engine::Decimal::equals | ( | const Decimal & | rv | ) | const |
throw | ( | ||||
) |
Compares two Decimals.
rv | Value to compare with. |
|
static |
Contructor Constructs object from double.
v | Value of the double type |
precision | Number of digits after point. |
|
static |
Contructor Constructs object from double.
v | Value of the double type |
|
inlinestatic |
Converts string to Decimal.
Referenced by fixToBin_Decimal32NULL(), fixToBin_Decimal64NULL(), fixToBin_PRICE9(), and fixToBin_PRICENULL9().
|
static |
Converts string to Decimal.
|
static |
Converts wide-string to Decimal.
|
inline |
Returns exponent part of the value.
Referenced by fixToBin_Decimal32NULL(), and fixToBin_Decimal64NULL().
|
inline |
Returns mantissa part of the value.
Referenced by fixToBin_Decimal32NULL(), fixToBin_Decimal64NULL(), fixToBin_PRICE9(), and fixToBin_PRICENULL9().
bool Engine::Decimal::operator!= | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
bool Engine::Decimal::operator< | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
bool Engine::Decimal::operator<= | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
bool Engine::Decimal::operator== | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
bool Engine::Decimal::operator> | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
bool Engine::Decimal::operator>= | ( | Engine::Decimal const & | val | ) | const |
throw | ( | ||||
) |
Compares two decimals.
double Engine::Decimal::toDouble | ( | ) | const | |
throw | ( | |||
) |
Converts stored value to double.
float Engine::Decimal::toFloat | ( | ) | const | |
throw | ( | |||
) |
Converts stored value to float.
std::string Engine::Decimal::toStdString | ( | ) | const |
Converts decimal to FIX string.
Converts decimal to FIX string
char* Engine::Decimal::toString | ( | char * | buf | ) | const |
throw | ( | ||||
) |
Converts decimal to FIX string.
[out] | buf | Buffer to convert to. Should be enough to store Engine::Decimal::ValueSize bytes. |
char* Engine::Decimal::toString | ( | char * | buf, |
std::size_t | size | ||
) | const | ||
throw | ( | ||
) |
If result string is less than passed buffer, remain chars will be filled with zeros according to FIX protocol.
[out] | buf | Buffer to convert to. |
[in] | size | Size of the buffer. |
|
static |
Maximum buffer size required to store value.