osgEarth 2.1.1
|
Public Member Functions | |
optional () | |
optional (T defaultValue) | |
optional (T defaultValue, T value) | |
optional (const optional< T > &rhs) | |
virtual | ~optional () |
optional< T > & | operator= (const optional< T > &rhs) |
const T & | operator= (const T &value) |
bool | operator== (const optional< T > &rhs) const |
bool | operator!= (const optional< T > &rhs) const |
bool | operator== (const T &value) const |
bool | operator!= (const T &value) const |
bool | isSetTo (const T &value) const |
bool | isSet () const |
void | unset () |
const T & | get () const |
const T & | value () const |
const T & | defaultValue () const |
T & | mutable_value () |
void | init (T defValue) |
operator const T * () const | |
T * | operator-> () |
const T * | operator-> () const |
operator unspecified_bool_type () const | |
Private Types | |
typedef T *optional:: | unspecified_bool_type |
Private Attributes | |
bool | _set |
T | _value |
T | _defaultValue |
A template for defining "optional" class members. An optional member has a default value and a flag indicating whether the member is "set". This is used extensively in osgEarth's ConfigOptions subsystem.
typedef T* optional:: osgEarth::optional< T >::unspecified_bool_type [private] |
osgEarth::optional< T >::optional | ( | ) | [inline] |
Definition at line 52 of file Common.
: _set(false), _value(T()), _defaultValue(T()) { }
osgEarth::optional< T >::optional | ( | T | defaultValue | ) | [inline] |
Definition at line 53 of file Common.
: _set(false), _value(defaultValue), _defaultValue(defaultValue) { }
osgEarth::optional< T >::optional | ( | T | defaultValue, |
T | value | ||
) | [inline] |
Definition at line 54 of file Common.
: _set(true), _value(value), _defaultValue(defaultValue) { }
osgEarth::optional< T >::optional | ( | const optional< T > & | rhs | ) | [inline] |
virtual osgEarth::optional< T >::~optional | ( | ) | [inline, virtual] |
const T& osgEarth::optional< T >::defaultValue | ( | ) | const [inline] |
Definition at line 70 of file Common.
{ return _defaultValue; }
const T& osgEarth::optional< T >::get | ( | ) | const [inline] |
void osgEarth::optional< T >::init | ( | T | defValue | ) | [inline] |
Definition at line 75 of file Common.
{ _value=defValue; _defaultValue=defValue; unset(); }
bool osgEarth::optional< T >::isSet | ( | ) | const [inline] |
bool osgEarth::optional< T >::isSetTo | ( | const T & | value | ) | const [inline] |
T& osgEarth::optional< T >::mutable_value | ( | ) | [inline] |
osgEarth::optional< T >::operator const T * | ( | ) | const [inline] |
osgEarth::optional< T >::operator unspecified_bool_type | ( | ) | const [inline] |
bool osgEarth::optional< T >::operator!= | ( | const optional< T > & | rhs | ) | const [inline] |
bool osgEarth::optional< T >::operator!= | ( | const T & | value | ) | const [inline] |
const T* osgEarth::optional< T >::operator-> | ( | ) | const [inline] |
T* osgEarth::optional< T >::operator-> | ( | ) | [inline] |
const T& osgEarth::optional< T >::operator= | ( | const T & | value | ) | [inline] |
optional<T>& osgEarth::optional< T >::operator= | ( | const optional< T > & | rhs | ) | [inline] |
Definition at line 57 of file Common.
{ _set=rhs._set; _value=rhs._value; _defaultValue=rhs._defaultValue; return *this; }
bool osgEarth::optional< T >::operator== | ( | const optional< T > & | rhs | ) | const [inline] |
bool osgEarth::optional< T >::operator== | ( | const T & | value | ) | const [inline] |
void osgEarth::optional< T >::unset | ( | ) | [inline] |
Definition at line 65 of file Common.
{ _set = false; _value=_defaultValue; }
const T& osgEarth::optional< T >::value | ( | ) | const [inline] |
T osgEarth::optional< T >::_defaultValue [private] |
bool osgEarth::optional< T >::_set [private] |
T osgEarth::optional< T >::_value [private] |