osgEarth 2.1.1
Public Member Functions | Private Attributes

osgEarth::qualified_double< T > Class Template Reference

Collaboration diagram for osgEarth::qualified_double< T >:

List of all members.

Public Member Functions

 qualified_double (double value, const Units &units)
 qualified_double (const T &rhs)
void set (double value, const Units &units)
T & operator= (const T &rhs)
operator+ (const T &rhs) const
operator- (const T &rhs) const
bool operator== (const T &rhs) const
bool operator!= (const T &rhs) const
bool operator< (const T &rhs) const
bool operator> (const T &rhs) const
double as (const Units &convertTo) const
const UnitsgetUnits () const

Private Attributes

double _value
Units _units

Detailed Description

template<typename T>
class osgEarth::qualified_double< T >

Definition at line 158 of file Units.


Constructor & Destructor Documentation

template<typename T>
osgEarth::qualified_double< T >::qualified_double ( double  value,
const Units units 
) [inline]

Definition at line 161 of file Units.

: _value(value), _units(units) { }
template<typename T>
osgEarth::qualified_double< T >::qualified_double ( const T &  rhs) [inline]

Definition at line 163 of file Units.

: _value(rhs._value), _units(rhs._units) { }

Member Function Documentation

template<typename T>
double osgEarth::qualified_double< T >::as ( const Units convertTo) const [inline]

Definition at line 204 of file Units.

                                                  {
            return _units.convertTo( convertTo, _value );
        }

Here is the caller graph for this function:

template<typename T>
const Units& osgEarth::qualified_double< T >::getUnits ( ) const [inline]

Definition at line 208 of file Units.

{ return _units; }
template<typename T>
bool osgEarth::qualified_double< T >::operator!= ( const T &  rhs) const [inline]

Definition at line 192 of file Units.

                                                {
            return !_units.canConvert(rhs._units) || rhs.as(_units) != _value;
        }
template<typename T>
T osgEarth::qualified_double< T >::operator+ ( const T &  rhs) const [inline]

Definition at line 176 of file Units.

                                            {
            return _units.canConvert(rhs._units) ?
                T(_value + rhs.as(_units), _units) :
                T(0, Units());
        }
template<typename T>
T osgEarth::qualified_double< T >::operator- ( const T &  rhs) const [inline]

Definition at line 182 of file Units.

                                            {
            return _units.canConvert(rhs._units) ? 
                T(_value - rhs.as(_units), _units) :
                T(0, Units());
        }
template<typename T>
bool osgEarth::qualified_double< T >::operator< ( const T &  rhs) const [inline]

Definition at line 196 of file Units.

                                               {
            return _units.canConvert(rhs._units) && _value < rhs.as(_units);
        }
template<typename T>
T& osgEarth::qualified_double< T >::operator= ( const T &  rhs) [inline]

Definition at line 170 of file Units.

                                       {
            if ( _units.canConvert(rhs._units) )
                _value = rhs.as(_units);
            return static_cast<T&>(*this);
        }
template<typename T>
bool osgEarth::qualified_double< T >::operator== ( const T &  rhs) const [inline]

Definition at line 188 of file Units.

                                                {
            return _units.canConvert( rhs._units ) && rhs.as(_units) == _value;
        }
template<typename T>
bool osgEarth::qualified_double< T >::operator> ( const T &  rhs) const [inline]

Definition at line 200 of file Units.

                                               {
            return _units.canConvert(rhs._units) && _value > rhs.as(_units);
        }
template<typename T>
void osgEarth::qualified_double< T >::set ( double  value,
const Units units 
) [inline]

Definition at line 165 of file Units.

                                                     {
            _value = value;
            _units = units;
        }

Here is the caller graph for this function:


Member Data Documentation

template<typename T>
Units osgEarth::qualified_double< T >::_units [private]

Definition at line 212 of file Units.

template<typename T>
double osgEarth::qualified_double< T >::_value [private]

Definition at line 211 of file Units.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines