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
[legend]
List of all members.

Public Member Functions

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

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 247 of file rmath.h.


Constructor & Destructor Documentation

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

C'tor.

Definition at line 251 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 257 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 264 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 >::clear ( void   )  [inline]

Clear the value.

Definition at line 271 of file rmath.h.

References safe_num< T >::m_num.

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

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

Return the value.

Definition at line 277 of file rmath.h.

References safe_num< T >::m_num.

Referenced by safe_num< T >::add(), safe_num< T >::assign(), safe_num< T >::divide(), safe_num< T >::multiply(), safe_num< T >::operator!=(), operator%(), safe_num< T >::operator%=(), safe_num< T >::operator<(), safe_num< T >::operator<=(), safe_num< T >::operator==(), safe_num< T >::operator>(), safe_num< T >::operator>=(), percent_string(), safe_num< T >::safe_num(), size_to_string(), safe_num< T >::subtract(), test5(), test6(), test8(), and vault_manager::usage().

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

Assign a value.

Definition at line 283 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 >::add ( const T &  a_arg  )  [inline]

Add a value.

Definition at line 289 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 >::subtract ( const T &  a_arg  )  [inline]

Subtract a value.

Definition at line 322 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 >::multiply ( const T &  a_arg  )  [inline]

Multiply by a value.

Definition at line 361 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 >::divide ( const T &  a_arg  )  [inline]

Divide by a value.

Definition at line 420 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 >::assign ( const safe_num< T > &  a_class  )  [inline]

Assign a safe_num.

Definition at line 468 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 >::add ( const safe_num< T > &  a_class  )  [inline]

Add a safe_num.

Definition at line 474 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 >::subtract ( const safe_num< T > &  a_class  )  [inline]

Subtract a safe_num.

Definition at line 480 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>
void safe_num< T >::multiply ( const safe_num< T > &  a_class  )  [inline]

Multiply by a safe_num.

Definition at line 486 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>
void safe_num< T >::divide ( const safe_num< T > &  a_class  )  [inline]

Divide by a safe_num.

Definition at line 492 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>
const bool safe_num< T >::operator== ( const T &  a_arg  )  const [inline]

Boolean operator.

Definition at line 498 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 508 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 518 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 528 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 538 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 548 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 558 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 568 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 578 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 588 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 598 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 608 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 618 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 626 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 634 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 642 of file rmath.h.

References safe_num< T >::divide().

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 650 of file rmath.h.

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

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 658 of file rmath.h.

Referenced by safe_num< T >::add(), safe_num< T >::assign(), safe_num< T >::clear(), safe_num< T >::divide(), safe_num< T >::multiply(), safe_num< T >::operator!=(), safe_num< T >::operator%=(), safe_num< T >::operator<(), safe_num< T >::operator<=(), safe_num< T >::operator==(), safe_num< T >::operator>(), safe_num< T >::operator>=(), safe_num< T >::safe_num(), safe_num< T >::subtract(), and safe_num< T >::value().


The documentation for this class was generated from the following file:
Generated on Tue Jul 1 12:11:57 2008 for rvm by  doxygen 1.5.1