Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

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 ()
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


Member Function Documentation

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.

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>
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>
T YAnyOpt< T >::value  )  const [inline]
 

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


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 Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6