library of assembled shared sources

http://lass.cocamware.com

lass::num::Modulo< N, T > Class Template Reference

a integer number class using modulo arithmetic More...

#include <modulo.h>

Inheritance diagram for lass::num::Modulo< N, T >:

Inheritance graph
[legend]

Data Structures

struct  Rebind

Public Types

typedef Modulo< N, T > TSelf
typedef util::CallTraits< T >
::TValue 
TValue
typedef util::CallTraits< T >
::TParam 
TParam

Public Member Functions

 Modulo (TParam iValue=0)
Modulo< N, T > operator+ () const
Modulo< N, T > operator- () const
Modulo< N, T > & operator++ ()
Modulo< N, T > & operator-- ()
Modulo< N, T > operator++ (int)
Modulo< N, T > operator-- (int)
Modulo< N, T > & operator+= (const Modulo< N, T > &iB)
Modulo< N, T > & operator-= (const Modulo< N, T > &iB)
Modulo< N, T > & operator*= (const Modulo< N, T > &iB)
Modulo< N, T > & operator/= (const Modulo< N, T > &iB)
 operator T () const
TParam value () const

Private Member Functions

bool isInRange (TParam iValue) const

Private Attributes

TValue value_

Detailed Description

template<unsigned N, typename T = int>
class lass::num::Modulo< N, T >

a integer number class using modulo arithmetic

Author:
Bram de Greve [BdG]
Warning:
under development!
Bug:
what happens if the temporary result of an operation does not fit in the range of T?

Definition at line 66 of file modulo.h.


Member Typedef Documentation

template<unsigned N, typename T = int>
typedef Modulo<N, T> lass::num::Modulo< N, T >::TSelf

Definition at line 70 of file modulo.h.

template<unsigned N, typename T = int>
typedef util::CallTraits<T>::TValue lass::num::Modulo< N, T >::TValue

Definition at line 72 of file modulo.h.

template<unsigned N, typename T = int>
typedef util::CallTraits<T>::TParam lass::num::Modulo< N, T >::TParam

Definition at line 73 of file modulo.h.


Constructor & Destructor Documentation

template<unsigned N, typename T >
lass::num::Modulo< N, T >::Modulo ( TParam  iValue = 0  )  [inline]

Definition at line 62 of file modulo.inl.

References LASS_ASSERT.


Member Function Documentation

template<unsigned N, typename T >
Modulo< N, T > lass::num::Modulo< N, T >::operator+ (  )  const [inline]

Definition at line 71 of file modulo.inl.

template<unsigned N, typename T >
Modulo< N, T > lass::num::Modulo< N, T >::operator- (  )  const [inline]

Definition at line 79 of file modulo.inl.

References lass::num::Modulo< N, T >::value_.

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator++ (  )  [inline]

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator-- (  )  [inline]

template<unsigned N, typename T >
Modulo< N, T > lass::num::Modulo< N, T >::operator++ ( int   )  [inline]

Definition at line 115 of file modulo.inl.

template<unsigned N, typename T >
Modulo< N, T > lass::num::Modulo< N, T >::operator-- ( int   )  [inline]

Definition at line 125 of file modulo.inl.

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator+= ( const Modulo< N, T > &  iB  )  [inline]

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator-= ( const Modulo< N, T > &  iB  )  [inline]

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator*= ( const Modulo< N, T > &  iB  )  [inline]

template<unsigned N, typename T >
Modulo< N, T > & lass::num::Modulo< N, T >::operator/= ( const Modulo< N, T > &  iB  )  [inline]

template<unsigned N, typename T >
lass::num::Modulo< N, T >::operator T (  )  const [inline]

Definition at line 185 of file modulo.inl.

References lass::num::Modulo< N, T >::value_.

template<unsigned N, typename T >
Modulo< N, T >::TParam lass::num::Modulo< N, T >::value (  )  const [inline]

Definition at line 193 of file modulo.inl.

References lass::num::Modulo< N, T >::value_.

Referenced by lass::num::operator==().

template<unsigned N, typename T >
bool lass::num::Modulo< N, T >::isInRange ( TParam  iValue  )  const [inline, private]


Field Documentation

template<unsigned N, typename T = int>
TValue lass::num::Modulo< N, T >::value_ [private]


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

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo