torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Value::Number Class Reference

#include <Value.hpp>

Public Member Functions

 Number ()
 
 Number (int32_t inMantissa, int32_t inExponent)
 
 ~Number () throw ()
 
 Number (const Number &inSource)
 
Numberoperator= (const Number &inSource)
 
bool operator< (const Number &inRhs) const
 
bool operator== (const Number &inRhs) const
 
bool operator> (const Number &inRhs) const
 
bool operator>= (const Number &inRhs) const
 
bool operator<= (const Number &inRhs) const
 
bool operator!= (const Number &inRhs) const
 
const int32_t getMantissa () const
 
void setMantissa (const int32_t &inSource)
 
const int32_t getExponent () const
 
void setExponent (const int32_t &inSource)
 
double eval () const
 

Private Attributes

int32_t mMantissa
 
int32_t mExponent
 

Detailed Description

Represents a decimal number. This is used to represent decimal floating point numbers in EDIF. This has a exponent and mantissa part.

Definition at line 67 of file Value.hpp.

Constructor & Destructor Documentation

torc::generic::Value::Number::Number ( )

Definition at line 92 of file Value.cpp.

torc::generic::Value::Number::Number ( int32_t  inMantissa,
int32_t  inExponent 
)

Definition at line 94 of file Value.cpp.

94  : mMantissa(inMantissa),
95  mExponent(inExponent) {}
torc::generic::Value::Number::~Number ( )
throw (
)

Definition at line 97 of file Value.cpp.

97 {}
torc::generic::Value::Number::Number ( const Number inSource)

Definition at line 99 of file Value.cpp.

99  : mMantissa(inSource.mMantissa),
100  mExponent(inSource.mExponent) {}

Member Function Documentation

double torc::generic::Value::Number::eval ( ) const

Definition at line 142 of file Value.cpp.

142  {
143  return static_cast<double>(mMantissa) * pow(10, static_cast<double>(mExponent));
144 }

+ Here is the caller graph for this function:

const int32_t torc::generic::Value::Number::getExponent ( ) const
inline

Definition at line 331 of file Value.hpp.

331  {
332  return mExponent;
333 }

+ Here is the caller graph for this function:

const int32_t torc::generic::Value::Number::getMantissa ( ) const
inline

Definition at line 327 of file Value.hpp.

327  {
328  return mMantissa;
329 }

+ Here is the caller graph for this function:

bool torc::generic::Value::Number::operator!= ( const Number inRhs) const

Definition at line 130 of file Value.cpp.

130  {
131  return !operator ==(inRhs);
132 }
bool operator==(const Number &inRhs) const
Definition: Value.cpp:114

+ Here is the call graph for this function:

bool torc::generic::Value::Number::operator< ( const Number inRhs) const

Definition at line 110 of file Value.cpp.

110  {
111  return eval() < inRhs.eval();
112 }
double eval() const
Definition: Value.cpp:142

+ Here is the call graph for this function:

bool torc::generic::Value::Number::operator<= ( const Number inRhs) const

Definition at line 126 of file Value.cpp.

126  {
127  return eval() <= inRhs.eval();
128 }
double eval() const
Definition: Value.cpp:142

+ Here is the call graph for this function:

Value::Number & torc::generic::Value::Number::operator= ( const Number inSource)

Definition at line 102 of file Value.cpp.

102  {
103  if(this != &inSource) {
104  mMantissa = inSource.mMantissa;
105  mExponent = inSource.mExponent;
106  }
107  return *this;
108 }
bool torc::generic::Value::Number::operator== ( const Number inRhs) const

Definition at line 114 of file Value.cpp.

114  {
115  return eval() == inRhs.eval();
116 }
double eval() const
Definition: Value.cpp:142

+ Here is the call graph for this function:

bool torc::generic::Value::Number::operator> ( const Number inRhs) const

Definition at line 118 of file Value.cpp.

118  {
119  return eval() > inRhs.eval();
120 }
double eval() const
Definition: Value.cpp:142

+ Here is the call graph for this function:

bool torc::generic::Value::Number::operator>= ( const Number inRhs) const

Definition at line 122 of file Value.cpp.

122  {
123  return eval() >= inRhs.eval();
124 }
double eval() const
Definition: Value.cpp:142

+ Here is the call graph for this function:

void torc::generic::Value::Number::setExponent ( const int32_t &  inSource)

Definition at line 138 of file Value.cpp.

138  {
139  mExponent = inSource;
140 }
void torc::generic::Value::Number::setMantissa ( const int32_t &  inSource)

Definition at line 134 of file Value.cpp.

134  {
135  mMantissa = inSource;
136 }

Field Documentation

int32_t torc::generic::Value::Number::mExponent
private

Definition at line 74 of file Value.hpp.

int32_t torc::generic::Value::Number::mMantissa
private

Definition at line 73 of file Value.hpp.


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