OnixS BME SENAF Handler C++ library  2.2.1
API documentation
Rational Struct Reference

#include <OnixS/Senaf/MarketData/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 32 of file Rational.h.

Constructor & Destructor Documentation

Rational ( )
inline

Constructs default instance.

Definition at line 88 of file Rational.h.

Rational ( long long  numerator,
unsigned int  denominator 
)
inline

Create initialized instance.

Definition at line 94 of file Rational.h.

Rational ( const Rational other,
unsigned int  newDenominator 
)
inline

Converts some Rational value to another denominator.

Definition at line 100 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 115 of file Rational.h.

bool noValue ( ) const
inline

Indicates if Rational has no value.

Definition at line 109 of file Rational.h.

operator double ( ) const
inline

Implicit conversion to double number type.

Definition at line 125 of file Rational.h.

operator float ( ) const
inline

Implicit conversion to float number type.

Definition at line 120 of file Rational.h.

bool operator!= ( const Rational right) const
inline

Definition at line 140 of file Rational.h.

bool operator< ( const Rational right) const
inline

Definition at line 145 of file Rational.h.

bool operator<= ( const Rational right) const
inline

Definition at line 160 of file Rational.h.

bool operator== ( const Rational right) const
inline

Rational comparison.

Definition at line 130 of file Rational.h.

bool operator> ( const Rational right) const
inline

Definition at line 155 of file Rational.h.

bool operator>= ( const Rational right) const
inline

Definition at line 165 of file Rational.h.

std::string toString ( ) const

string representation of Rational

Member Data Documentation

unsigned int denominator

Denominator.

Definition at line 41 of file Rational.h.

const long long NO_VALUE
static

This value indicates that value is in not set.

Definition at line 35 of file Rational.h.

long long numerator

Numerator.

Definition at line 38 of file Rational.h.


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