YAnyOpt< T > Class Template Reference

Helper template class for options that may have some value or may be undefined. More...

#include <YWidgetOpt.h>

List of all members.

Public Member Functions

 YAnyOpt ()
virtual ~YAnyOpt ()
void setValue (T newValue)
void undef ()
bool defined () const
value () const

Protected Member Functions

virtual T defaultValue () const=0

Protected Attributes

bool _defined
_value


Detailed Description

template<class T>
class YAnyOpt< T >

Helper template class for options that may have some value or may be undefined.


Constructor & Destructor Documentation

template<class T>
YAnyOpt< T >::YAnyOpt (  )  [inline]

Constructor

template<class T>
virtual YAnyOpt< T >::~YAnyOpt (  )  [inline, virtual]

Destructor


Member Function Documentation

template<class T>
void YAnyOpt< T >::setValue ( newValue  )  [inline]

Set the value.

template<class T>
void YAnyOpt< T >::undef (  )  [inline]

Invalidate the value, i.e. make it undefined - just like at object creation time.

template<class T>
bool YAnyOpt< T >::defined (  )  const [inline]

Return whether or not the value is defined, i.e. whether or not a value has been set before.

template<class T>
T YAnyOpt< T >::value (  )  const [inline]

Returns the value of this option, if any has been defined, or the default value otherwise.

template<class T>
virtual T YAnyOpt< T >::defaultValue (  )  const [protected, pure virtual]

The default value - the value that will be returned if none has been explicitly set. Overwrite this method with the class specific default value.

Implemented in YBoolOpt, and YLongOpt.


Member Data Documentation

template<class T>
bool YAnyOpt< T >::_defined [protected]

template<class T>
T YAnyOpt< T >::_value [protected]


The documentation for this class was generated from the following file:
Generated on Tue Nov 6 01:20:22 2007 for yast2-core by  doxygen 1.5.0