fixed_base< T, FIXED_BITS > Class Template Reference

Fixed-point template base class. More...

#include <_fixed.h>

List of all members.

Public Types

typedef T value_type

Public Member Functions

 fixed_base () ETL_ATTRIB_INLINE
 fixed_base (const float &f) ETL_ATTRIB_INLINE
 fixed_base (const double &f) ETL_ATTRIB_INLINE
 fixed_base (const long double &f) ETL_ATTRIB_INLINE
 fixed_base (const int &i) ETL_ATTRIB_INLINE
 fixed_base (const int &n, const int &d) ETL_ATTRIB_INLINE
 Fraction constructor.
 fixed_base (const _fixed &x) ETL_ATTRIB_INLINE
 fixed_base (value_type x, raw) ETL_ATTRIB_INLINE
T & data () ETL_ATTRIB_PURE ETL_ATTRIB_INLINE
const T & data () const ETL_ATTRIB_PURE ETL_ATTRIB_INLINE
const _fixedoperator+= (const _fixed &rhs) ETL_ATTRIB_INLINE
 fixed+=fixed
const _fixedoperator-= (const _fixed &rhs) ETL_ATTRIB_INLINE
 fixed-=fixed
template<typename U>
const _fixedoperator *= (const U &rhs) ETL_ATTRIB_INLINE
template<typename U>
const _fixedoperator/= (const U &rhs) ETL_ATTRIB_INLINE
const _fixedoperator *= (const _fixed &rhs) ETL_ATTRIB_INLINE
 fixed*=fixed
const _fixedoperator/= (const _fixed &rhs) ETL_ATTRIB_INLINE
 fixed/=fixed
const _fixedoperator *= (const int &rhs) ETL_ATTRIB_INLINE
 fixed*=int
const _fixedoperator/= (const int &rhs) ETL_ATTRIB_INLINE
 fixed/=int
template<typename U>
_fixed operator+ (const U &rhs) const ETL_ATTRIB_INLINE
 fixed + ...
template<typename U>
_fixed operator- (const U &rhs) const ETL_ATTRIB_INLINE
 fixed - ...
template<typename U>
_fixed operator * (const U &rhs) const ETL_ATTRIB_INLINE
 fixed * ...
template<typename U>
_fixed operator/ (const U &rhs) const ETL_ATTRIB_INLINE
 fixed / ...
_fixed operator+ (const _fixed &rhs) const ETL_ATTRIB_INLINE
 fixed + fixed
_fixed operator- (const _fixed &rhs) const ETL_ATTRIB_INLINE
 fixed - fixed
_fixed operator * (const _fixed &rhs) const ETL_ATTRIB_INLINE
 fixed * fixed
_fixed operator/ (const _fixed &rhs) const ETL_ATTRIB_INLINE
 fixed / fixed
_fixed operator * (const int &rhs) const ETL_ATTRIB_INLINE
 fixed * int
_fixed operator/ (const int &rhs) const ETL_ATTRIB_INLINE
 fixed / int
_fixed operator * (const float &rhs) const ETL_ATTRIB_INLINE
 fixed * float
_fixed operator * (const double &rhs) const ETL_ATTRIB_INLINE
 fixed * double
_fixed operator- () const ETL_ATTRIB_INLINE
 operator float () const ETL_ATTRIB_INLINE
 operator double () const ETL_ATTRIB_INLINE
 operator long double () const ETL_ATTRIB_INLINE
 operator int () const ETL_ATTRIB_INLINE
 operator bool () const ETL_ATTRIB_INLINE
_fixed floor () const
_fixed ceil () const
_fixed round () const
bool operator== (const _fixed &rhs) const
bool operator!= (const _fixed &rhs) const
bool operator< (const _fixed &rhs) const
bool operator> (const _fixed &rhs) const
bool operator<= (const _fixed &rhs) const
bool operator>= (const _fixed &rhs) const

Private Types

typedef fixed_base< T, FIXED_BITS > _fixed
typedef fixed_base< T, FIXED_BITS > self_type

Static Private Member Functions

static bool _TYPE_SMALLER_THAN_INT () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static bool _USING_ALL_BITS () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static value_type _ONE () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static value_type _F_MASK () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE
static float _EPSILON () ETL_ATTRIB_CONST ETL_ATTRIB_INLINE

Private Attributes

_data

Classes

class  raw


Detailed Description

template<class T, unsigned int FIXED_BITS>
class fixed_base< T, FIXED_BITS >

Fixed-point template base class.

========================================================================

A more detailed description needs to be written.

Definition at line 95 of file _fixed.h.


Member Typedef Documentation

template<class T, unsigned int FIXED_BITS>
typedef T fixed_base< T, FIXED_BITS >::value_type
 

Definition at line 98 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
typedef fixed_base<T,FIXED_BITS> fixed_base< T, FIXED_BITS >::_fixed [private]
 

Definition at line 102 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
typedef fixed_base<T,FIXED_BITS> fixed_base< T, FIXED_BITS >::self_type [private]
 

Definition at line 103 of file _fixed.h.


Constructor & Destructor Documentation

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base  ) 
 

Definition at line 172 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const float &  f  ) 
 

Definition at line 180 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const double &  f  ) 
 

Definition at line 184 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const long double &  f  ) 
 

Definition at line 188 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const int &  i  ) 
 

Definition at line 192 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const int &  n,
const int &  d
 

Fraction constructor.

Definition at line 199 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base const _fixed x  ) 
 

Definition at line 176 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::fixed_base value_type  x,
raw 
 

Definition at line 196 of file _fixed.h.


Member Function Documentation

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT  )  [inline, static, private]
 

Definition at line 204 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::operator *=(), and fixed_base< T, FIXED_BITS >::operator/=().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::_USING_ALL_BITS  )  [inline, static, private]
 

Definition at line 210 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
T fixed_base< T, FIXED_BITS >::_ONE  )  [inline, static, private]
 

Definition at line 216 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_USING_ALL_BITS().

Referenced by fixed_base< T, FIXED_BITS >::_EPSILON(), fixed_base< T, FIXED_BITS >::_F_MASK(), fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::operator double(), fixed_base< T, FIXED_BITS >::operator float(), fixed_base< T, FIXED_BITS >::operator long double(), and fixed_base< T, FIXED_BITS >::round().

template<class T, unsigned int FIXED_BITS>
T fixed_base< T, FIXED_BITS >::_F_MASK  )  [inline, static, private]
 

Definition at line 222 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_ONE(), and fixed_base< T, FIXED_BITS >::_USING_ALL_BITS().

Referenced by fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::floor(), and fixed_base< T, FIXED_BITS >::round().

template<class T, unsigned int FIXED_BITS>
float fixed_base< T, FIXED_BITS >::_EPSILON  )  [inline, static, private]
 

Definition at line 228 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
T & fixed_base< T, FIXED_BITS >::data  ) 
 

Definition at line 235 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

Referenced by fastangle::cos::cos(), fastangle::tan::get(), fastangle::cos::get(), fastangle::sin::get(), fixed_base< T, FIXED_BITS >::operator!=(), fixed_base< T, FIXED_BITS >::operator<(), fixed_base< T, FIXED_BITS >::operator<=(), fixed_base< T, FIXED_BITS >::operator==(), fixed_base< T, FIXED_BITS >::operator>(), fixed_base< T, FIXED_BITS >::operator>=(), fastangle::sin::sin(), and fastangle::tan::tan().

template<class T, unsigned int FIXED_BITS>
const T & fixed_base< T, FIXED_BITS >::data  )  const
 

Definition at line 241 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator+= const _fixed rhs  ) 
 

fixed+=fixed

Definition at line 248 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator-= const _fixed rhs  ) 
 

fixed-=fixed

Definition at line 256 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
template<typename U>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator *= const U &  rhs  ) 
 

Definition at line 292 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= const U &  rhs  ) 
 

Definition at line 298 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator *= const _fixed rhs  ) 
 

fixed*=fixed

Definition at line 264 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT().

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= const _fixed rhs  ) 
 

fixed/=fixed

Definition at line 279 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_TYPE_SMALLER_THAN_INT().

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator *= const int &  rhs  ) 
 

fixed*=int

Definition at line 305 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
const fixed_base< T, FIXED_BITS > & fixed_base< T, FIXED_BITS >::operator/= const int &  rhs  ) 
 

fixed/=int

Definition at line 312 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
template<typename U>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator+ const U &  rhs  )  const
 

fixed + ...

Definition at line 363 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator- const U &  rhs  )  const
 

fixed - ...

Definition at line 370 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::operator-().

template<class T, unsigned int FIXED_BITS>
template<typename U>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator * const U &  rhs  )  const
 

fixed * ...

Definition at line 377 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
template<typename U>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ const U &  rhs  )  const
 

fixed / ...

Definition at line 384 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator+ const _fixed rhs  )  const
 

fixed + fixed

Definition at line 325 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator- const _fixed rhs  )  const
 

fixed - fixed

Definition at line 334 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator * const _fixed rhs  )  const
 

fixed * fixed

Definition at line 343 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ const _fixed rhs  )  const
 

fixed / fixed

Definition at line 353 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator * const int &  rhs  )  const
 

fixed * int

Definition at line 391 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator/ const int &  rhs  )  const
 

fixed / int

Definition at line 416 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator * const float &  rhs  )  const
 

fixed * float

Definition at line 401 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator * const double &  rhs  )  const
 

fixed * double

Definition at line 408 of file _fixed.h.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::operator-  )  const
 

Definition at line 445 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

Referenced by fixed_base< T, FIXED_BITS >::operator-().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::operator float  )  const [inline]
 

Definition at line 452 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::operator double  )  const [inline]
 

Definition at line 458 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::operator long double  )  const [inline]
 

Definition at line 464 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::operator int  )  const [inline]
 

Definition at line 470 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS >::operator bool  )  const [inline]
 

Definition at line 476 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data.

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::floor  )  const
 

Definition at line 483 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, and fixed_base< T, FIXED_BITS >::_F_MASK().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::ceil  )  const
 

Definition at line 491 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
fixed_base< T, FIXED_BITS > fixed_base< T, FIXED_BITS >::round  )  const
 

Definition at line 502 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::_data, fixed_base< T, FIXED_BITS >::_F_MASK(), and fixed_base< T, FIXED_BITS >::_ONE().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator== const _fixed rhs  )  const [inline]
 

Definition at line 162 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator!= const _fixed rhs  )  const [inline]
 

Definition at line 163 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator< const _fixed rhs  )  const [inline]
 

Definition at line 164 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator> const _fixed rhs  )  const [inline]
 

Definition at line 165 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator<= const _fixed rhs  )  const [inline]
 

Definition at line 166 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().

template<class T, unsigned int FIXED_BITS>
bool fixed_base< T, FIXED_BITS >::operator>= const _fixed rhs  )  const [inline]
 

Definition at line 167 of file _fixed.h.

References fixed_base< T, FIXED_BITS >::data().


Member Data Documentation

template<class T, unsigned int FIXED_BITS>
T fixed_base< T, FIXED_BITS >::_data [private]
 

Definition at line 100 of file _fixed.h.

Referenced by fixed_base< T, FIXED_BITS >::ceil(), fixed_base< T, FIXED_BITS >::data(), fixed_base< T, FIXED_BITS >::floor(), fixed_base< T, FIXED_BITS >::operator *(), fixed_base< T, FIXED_BITS >::operator *=(), fixed_base< T, FIXED_BITS >::operator bool(), fixed_base< T, FIXED_BITS >::operator double(), fixed_base< T, FIXED_BITS >::operator float(), fixed_base< T, FIXED_BITS >::operator int(), fixed_base< T, FIXED_BITS >::operator long double(), fixed_base< T, FIXED_BITS >::operator+(), fixed_base< T, FIXED_BITS >::operator+=(), fixed_base< T, FIXED_BITS >::operator-(), fixed_base< T, FIXED_BITS >::operator-=(), fixed_base< T, FIXED_BITS >::operator/(), fixed_base< T, FIXED_BITS >::operator/=(), and fixed_base< T, FIXED_BITS >::round().


The documentation for this class was generated from the following file:
Generated on Thu Jan 12 03:51:42 2006 for ETL by  doxygen 1.4.6