rvm  1.11
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
safe_num< T > Class Template Reference

Safely manipulate numbers without worryiung about over/underflow error. More...

#include <rmath.h>

Collaboration diagram for safe_num< T >:
Collaboration graph

Public Member Functions

 safe_num ()
 C'tor. More...
 
 safe_num (const T a_num)
 C'tor. More...
 
 safe_num (const safe_num &a_class)
 C'tor. More...
 
void clear (void)
 Clear the value. More...
 
const T value (void) const
 Return the value. More...
 
void assign (const T &a_arg)
 Assign a value. More...
 
void add (const T &a_arg)
 Add a value. More...
 
void subtract (const T &a_arg)
 Subtract a value. More...
 
void multiply (const T &a_arg)
 Multiply by a value. More...
 
void divide (const T &a_arg)
 Divide by a value. More...
 
void assign (const safe_num< T > &a_class)
 Assign a safe_num. More...
 
void add (const safe_num< T > &a_class)
 Add a safe_num. More...
 
void subtract (const safe_num< T > &a_class)
 Subtract a safe_num. More...
 
void multiply (const safe_num< T > &a_class)
 Multiply by a safe_num. More...
 
void divide (const safe_num< T > &a_class)
 Divide by a safe_num. More...
 
const bool operator== (const T &a_arg) const
 Boolean operator. More...
 
const bool operator== (const safe_num< T > &a_class) const
 Boolean operator. More...
 
const bool operator!= (const T &a_arg) const
 Boolean operator. More...
 
const bool operator!= (const safe_num< T > &a_class) const
 Boolean operator. More...
 
const bool operator< (const T &a_arg) const
 Boolean operator. More...
 
const bool operator< (const safe_num< T > &a_class) const
 Boolean operator. More...
 
const bool operator> (const T &a_arg) const
 Boolean operator. More...
 
const bool operator> (const safe_num< T > &a_class) const
 Boolean operator. More...
 
const bool operator<= (const T &a_arg) const
 Boolean operator. More...
 
const bool operator<= (const safe_num< T > &a_class) const
 Boolean operator. More...
 
const bool operator>= (const T &a_arg) const
 Boolean operator. More...
 
const bool operator>= (const safe_num< T > &a_class) const
 Boolean operator. More...
 
safe_num< T > & operator+= (safe_num< T > a_class)
 Arithmetic operator. More...
 
safe_num< T > & operator-= (safe_num< T > a_class)
 Arithmetic operator. More...
 
safe_num< T > & operator*= (safe_num< T > a_class)
 Arithmetic operator. More...
 
safe_num< T > & operator/= (safe_num< T > a_class)
 Arithmetic operator. More...
 
safe_num< T > & operator%= (safe_num< T > a_class)
 Arithmetic operator. More...
 

Private Attributes

m_num
 

Detailed Description

template<typename T>
class safe_num< T >

Safely manipulate numbers without worryiung about over/underflow error.

Definition at line 281 of file rmath.h.

Constructor & Destructor Documentation

template<typename T>
safe_num< T >::safe_num ( )
inline

C'tor.

Definition at line 285 of file rmath.h.

References safe_num< T >::clear().

Here is the call graph for this function:

template<typename T>
safe_num< T >::safe_num ( const T  a_num)
inline

C'tor.

Definition at line 291 of file rmath.h.

References safe_num< T >::clear(), and safe_num< T >::m_num.

Here is the call graph for this function:

template<typename T>
safe_num< T >::safe_num ( const safe_num< T > &  a_class)
inline

C'tor.

Definition at line 298 of file rmath.h.

References safe_num< T >::clear(), safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

Member Function Documentation

template<typename T>
void safe_num< T >::add ( const T &  a_arg)
inline

Add a value.

Definition at line 323 of file rmath.h.

References absolute(), INTERNAL_ERROR, is_char(), safe_num< T >::m_num, and safe_num< T >::subtract().

Referenced by safe_num< T >::add(), operator+(), operator++(), safe_num< T >::operator+=(), and safe_num< T >::subtract().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::add ( const safe_num< T > &  a_class)
inline

Add a safe_num.

Definition at line 508 of file rmath.h.

References safe_num< T >::add(), and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::assign ( const T &  a_arg)
inline

Assign a value.

Definition at line 317 of file rmath.h.

References safe_num< T >::m_num.

Referenced by safe_num< T >::assign(), operator%(), operator*(), operator+(), operator++(), operator-(), operator--(), and operator/().

template<typename T>
void safe_num< T >::assign ( const safe_num< T > &  a_class)
inline

Assign a safe_num.

Definition at line 502 of file rmath.h.

References safe_num< T >::assign(), and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::clear ( void  )
inline

Clear the value.

Definition at line 305 of file rmath.h.

References safe_num< T >::m_num.

Referenced by safe_num< T >::safe_num().

template<typename T>
void safe_num< T >::divide ( const T &  a_arg)
inline

Divide by a value.

Definition at line 454 of file rmath.h.

References INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.

Referenced by safe_num< T >::divide(), operator/(), and safe_num< T >::operator/=().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::divide ( const safe_num< T > &  a_class)
inline

Divide by a safe_num.

Definition at line 526 of file rmath.h.

References safe_num< T >::divide(), and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::multiply ( const T &  a_arg)
inline

Multiply by a value.

Definition at line 395 of file rmath.h.

References ASSERT, INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.

Referenced by safe_num< T >::multiply(), operator*(), and safe_num< T >::operator*=().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::multiply ( const safe_num< T > &  a_class)
inline

Multiply by a safe_num.

Definition at line 520 of file rmath.h.

References safe_num< T >::multiply(), and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator!= ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 552 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator!= ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 562 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
safe_num<T>& safe_num< T >::operator%= ( safe_num< T >  a_class)
inline

Arithmetic operator.

Definition at line 684 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
safe_num<T>& safe_num< T >::operator*= ( safe_num< T >  a_class)
inline

Arithmetic operator.

Definition at line 668 of file rmath.h.

References safe_num< T >::multiply().

Here is the call graph for this function:

template<typename T>
safe_num<T>& safe_num< T >::operator+= ( safe_num< T >  a_class)
inline

Arithmetic operator.

Definition at line 652 of file rmath.h.

References safe_num< T >::add().

Here is the call graph for this function:

template<typename T>
safe_num<T>& safe_num< T >::operator-= ( safe_num< T >  a_class)
inline

Arithmetic operator.

Definition at line 660 of file rmath.h.

References safe_num< T >::subtract().

Here is the call graph for this function:

template<typename T>
safe_num<T>& safe_num< T >::operator/= ( safe_num< T >  a_class)
inline

Arithmetic operator.

Definition at line 676 of file rmath.h.

References safe_num< T >::divide().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator< ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 572 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator< ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 582 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator<= ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 612 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator<= ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 622 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator== ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 532 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator== ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 542 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator> ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 592 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator> ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 602 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator>= ( const T &  a_arg) const
inline

Boolean operator.

Definition at line 632 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const bool safe_num< T >::operator>= ( const safe_num< T > &  a_class) const
inline

Boolean operator.

Definition at line 642 of file rmath.h.

References safe_num< T >::m_num, and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::subtract ( const T &  a_arg)
inline

Subtract a value.

Definition at line 356 of file rmath.h.

References absolute(), safe_num< T >::add(), INTERNAL_ERROR, is_char(), and safe_num< T >::m_num.

Referenced by safe_num< T >::add(), operator-(), operator--(), safe_num< T >::operator-=(), and safe_num< T >::subtract().

Here is the call graph for this function:

template<typename T>
void safe_num< T >::subtract ( const safe_num< T > &  a_class)
inline

Subtract a safe_num.

Definition at line 514 of file rmath.h.

References safe_num< T >::subtract(), and safe_num< T >::value().

Here is the call graph for this function:

template<typename T>
const T safe_num< T >::value ( void  ) const
inline

Member Data Documentation

template<typename T>
T safe_num< T >::m_num
private

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