Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::option::ListOption< T > Class Template Reference

#include <elm/option/ListOption.h>

+ Inheritance diagram for elm::option::ListOption< T >:

Public Member Functions

 ListOption (Manager &man, int tag,...)
 
 ListOption (Manager &man, int tag, VarArg &args)
 
 ListOption (const Make &make)
 
const T & get (int index) const
 
void set (int index, const T &value)
 
T & ref (int index)
 
void add (const T &val)
 
void remove (int index)
 
int count (void) const
 
 operator bool (void) const
 
const T & operator[] (int index) const
 
T & operator[] (int index)
 
virtual void process (String arg)
 
- Public Member Functions inherited from elm::option::AbstractValueOption
 AbstractValueOption (const Make &make)
 
 AbstractValueOption (Manager &man)
 
 AbstractValueOption (Manager &man, int tag,...)
 
 AbstractValueOption (Manager &man, int tag, VarArg &args)
 
virtual cstring description (void)
 
virtual usage_t usage (void)
 
virtual cstring argDescription (void)
 
- Public Member Functions inherited from elm::option::Option
 Option (void)
 
 Option (const Make &make)
 
virtual ~Option (void)
 
void output (io::Output &out)
 
virtual char shortName (void)
 
virtual CString longName (void)
 

Additional Inherited Members

- Protected Member Functions inherited from elm::option::AbstractValueOption
virtual void configure (Manager &manager, int tag, VarArg &args)
 
- Protected Member Functions inherited from elm::option::Option
void init (Manager &manager, int tag,...)
 
void init (Manager &manager, int tag, VarArg &args)
 
- Protected Attributes inherited from elm::option::Option
cstring desc
 

Detailed Description

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

Option that accepts a list of value, that is, accepts several command and their linked argument.

Parameters
TType of arguments.

Constructor & Destructor Documentation

template<class T >
elm::option::ListOption< T >::ListOption ( Manager man,
int  tag,
  ... 
)
Parameters
manOwner manager.
tagFirst tag.
...(tag, value) pair list (ended by end).

References elm::option::Option::init().

template<class T >
elm::option::ListOption< T >::ListOption ( Manager man,
int  tag,
VarArg args 
)
Parameters
manOwner manager.
tagFirst tag.
args(tag, value) pair list (ended by end).
template<class T >
elm::option::ListOption< T >::ListOption ( const Make make)

Member Function Documentation

template<class T >
void elm::option::ListOption< T >::add ( const T &  val)

Add a value to the list.

Parameters
valValue to add.
template<class T >
int elm::option::ListOption< T >::count ( void  ) const

Get the count of values.

Returns
Value count.
template<class T >
const T & elm::option::ListOption< T >::get ( int  index) const

Get the value at the given index.

Parameters
indexIndex of the requested value.
Returns
Value at the given index.
template<class T >
elm::option::ListOption< T >::operator bool ( void  ) const
template<class T >
const T& elm::option::ListOption< T >::operator[] ( int  index) const
template<class T >
T& elm::option::ListOption< T >::operator[] ( int  index)
template<class T >
virtual void elm::option::ListOption< T >::process ( String  arg)
virtual

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 elm::option::Option.

template<class T >
T & elm::option::ListOption< T >::ref ( int  index)

Get reference on a value.

Parameters
indexIndex of value to get reference for.
Returns
Reference of value matching the index.
template<class T >
void elm::option::ListOption< T >::remove ( int  index)

Remove value at the given index.

Parameters
indexIndex of the value to remove.
template<class T >
void elm::option::ListOption< T >::set ( int  index,
const T &  value 
)

Set a value in the list.

Parameters
indexIndex of the value to set.
valueValue to set.

References elm::value().


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