OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.17.0
API documentation
Rational Struct Reference

#include <Rational.h>

Public Member Functions

 Rational ()
 
 Rational (long long numerator, unsigned int denominator)
 
 Rational (const Rational &other, unsigned int newDenominator)
 
bool noValue () const
 
template<typename T >
convertTo () const
 
 operator float () const
 
 operator double () const
 
std::string toString () const
 
bool operator== (const Rational &right) const
 
bool operator!= (const Rational &right) const
 
bool operator< (const Rational &right) const
 
bool operator> (const Rational &right) const
 
bool operator<= (const Rational &right) const
 
bool operator>= (const Rational &right) const
 

Public Attributes

long long numerator
 
unsigned int denominator
 

Static Public Attributes

static const long long NO_VALUE
 

Detailed Description

Definition at line 30 of file Rational.h.

Constructor & Destructor Documentation

Rational ( )
inline

Constructs default instance.

Definition at line 86 of file Rational.h.

Rational ( long long  numerator,
unsigned int  denominator 
)
inline

Create initialized instance.

Definition at line 92 of file Rational.h.

Rational ( const Rational other,
unsigned int  newDenominator 
)
inline

Converts some Rational value to another denominator.

Definition at line 98 of file Rational.h.

Member Function Documentation

T convertTo ( ) const
inline

Converts Rational representation to needed number type.

Target number type should have accessible constructor from int type, and should have visible operator/.

Decimal d = rational.convertTo<Decimal>()

Definition at line 110 of file Rational.h.

bool noValue ( ) const
inline

Indicates if Rational has no value.

Definition at line 104 of file Rational.h.

operator double ( ) const
inline

Implicit conversion to double number type.

Definition at line 120 of file Rational.h.

operator float ( ) const
inline

Implicit conversion to float number type.

Definition at line 115 of file Rational.h.

bool operator!= ( const Rational right) const
inline

Definition at line 133 of file Rational.h.

bool operator< ( const Rational right) const
inline

Definition at line 138 of file Rational.h.

bool operator<= ( const Rational right) const
inline

Definition at line 151 of file Rational.h.

bool operator== ( const Rational right) const
inline

Rational comparison.

Definition at line 125 of file Rational.h.

bool operator> ( const Rational right) const
inline

Definition at line 146 of file Rational.h.

bool operator>= ( const Rational right) const
inline

Definition at line 156 of file Rational.h.

std::string toString ( ) const

string representation of Rational

Member Data Documentation

unsigned int denominator

Denominator.

Definition at line 39 of file Rational.h.

const long long NO_VALUE
static

This value indicates that value is in not set.

Definition at line 33 of file Rational.h.

long long numerator

Numerator.

Definition at line 36 of file Rational.h.


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