Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
ValueOption< T > Class Template Reference

#include <elm/option/ValueOption.h>

+ Inheritance diagram for ValueOption< T >:

Classes

class  Make
 

Public Member Functions

 ValueOption (void)
 
 ValueOption (const Make &make)
 
const T & get (void) const
 
void set (const T &value)
 
 operator const T & (void) const
 
ValueOption< T > & operator= (const T &value)
 
const T & operator* (void) const
 
 operator bool (void) const
 
virtual void process (String arg)
 
const T & value (void) const
 
- Public Member Functions inherited from AbstractValueOption
 AbstractValueOption (const Make &make)
 
 AbstractValueOption (Manager &man)
 
cstring description (void) override
 
usage_t usage (void) override
 
cstring argDescription (void) override
 
- Public Member Functions inherited from Option
 Option ()
 
 Option (const Make &make)
 
virtual ~Option ()
 

Additional Inherited Members

- Protected Attributes inherited from Option
cstring desc
 

Detailed Description

template<class T>
class elm::option::ValueOption< T >

A generic option template for option receiving an argument. It only requires to implement the process() virtual function.

Parameters
TType of value of the argument.

Constructor & Destructor Documentation

◆ ValueOption() [1/2]

ValueOption ( void  )
inline

◆ ValueOption() [2/2]

ValueOption ( const Make make)
inline

Member Function Documentation

◆ get()

const T & get ( void  ) const
inline

Get the argument value of the option.

Returns
Argument value.

Referenced by ValueOption< T >::operator bool(), ValueOption< T >::operator const T &(), and ValueOption< T >::operator*().

◆ operator bool()

operator bool ( void  ) const
inline

◆ operator const T &()

operator const T & ( void  ) const
inline

◆ operator*()

const T & operator* ( void  ) const
inline

Same as get().

References ValueOption< T >::get().

◆ operator=()

ValueOption< T > & operator= ( const T &  value)
inline

Same as set().

References ValueOption< T >::set().

◆ process()

virtual void process ( String  arg)
inlinevirtual

This method is called by the option manager when the option is encountered.

Parameters
argIf the option requires an argument, the value of the argument.

Implements Option.

◆ set()

void set ( const T &  value)
inline

Set the value of the option argument.

Parameters
valueValue to set.

References ValueOption< T >::value().

Referenced by ValueOption< T >::operator=().

◆ value()

const T& value ( void  ) const
inline

Referenced by ValueOption< T >::set().


The documentation for this class was generated from the following files: