tlp::ParameterDescriptionList Struct Reference
[Plugins]
This class describes parameters taken by a plugin.
More...
#include <WithParameter.h>
List of all members.
Public Member Functions
- ParameterDescriptionList ()
- template<typename T > void add (const char *parameterName, const char *help=NULL, const char *defaultValue=NULL, bool isMandatory=true, ParameterDirection direction=IN_PARAM)
- Adds a new parameter of type T to the list.
- tlp::Iterator
< ParameterDescription > * getParameters () const
- Retrieves an Iterator on the parameters.
- const std::string & getDefaultValue (const std::string ¶meterName) const
- retrieves the default value of a parameter.
- void setDefaultValue (const std::string ¶meterName, const std::string &value)
- Sets the default value of a parameter.
- bool isMandatory (const std::string ¶meterName) const
- Retrieves whether a parameter is mandatory or optional.
- void buildDefaultDataSet (DataSet &ioDataSet, Graph *inG=0) const
- Builds a DataSet containing the default values for each parameter. If the DataSet has a key which is equal to a parameter's name, the existing value is kept.
- unsigned int size () const
Detailed Description
This class describes parameters taken by a plugin.
It is used by WithParameter to store parameters. Each parameter is identified by a name, has a default value, a value, a help string, and a boolean indicating whether it is mandatory or optional.
Constructor & Destructor Documentation
tlp::ParameterDescriptionList::ParameterDescriptionList |
( |
|
) |
[inline] |
Member Function Documentation
template<typename T >
void tlp::ParameterDescriptionList::add |
( |
const char * |
parameterName, |
|
|
const char * |
help = NULL , |
|
|
const char * |
defaultValue = NULL , |
|
|
bool |
isMandatory = true , |
|
|
ParameterDirection |
direction = IN_PARAM | |
|
) |
| | [inline] |
Adds a new parameter of type T to the list.
- Parameters:
-
| parameterName | The name of the parameter. |
| help | The help string of this parameter. Defaults to std::string(). |
| defaultValue | The default value of this parameter. Defaults to std::string(). |
| isMandatory | Whether this parameter is mandatory or optional. Defaults to true. |
- Returns:
- void
void tlp::ParameterDescriptionList::buildDefaultDataSet |
( |
DataSet & |
ioDataSet, |
|
|
Graph * |
inG = 0 | |
|
) |
| | const |
Builds a DataSet containing the default values for each parameter. If the DataSet has a key which is equal to a parameter's name, the existing value is kept.
- Parameters:
-
| ioDataSet | The input dataset on which the parameters names will be associated with their default values. |
| inG | A graph on which to create properties if any parameter is of a property type. Defaults to 0. |
- Returns:
- void
const std::string& tlp::ParameterDescriptionList::getDefaultValue |
( |
const std::string & |
parameterName |
) |
const |
retrieves the default value of a parameter.
- Parameters:
-
| parameterName | The name of the parameter to retrieve the default value of. |
- Returns:
- The default value of the parameter:string
Retrieves an Iterator on the parameters.
- Returns:
- An iterator over the parameters :Iterator<ParameterDescription>*
bool tlp::ParameterDescriptionList::isMandatory |
( |
const std::string & |
parameterName |
) |
const |
Retrieves whether a parameter is mandatory or optional.
- Parameters:
-
| parameterName | The name of the parameter for which to check if it is mandatory or optional. |
- Returns:
- bool true if the parameter is mandatory, false if it is optional.
void tlp::ParameterDescriptionList::setDefaultValue |
( |
const std::string & |
parameterName, |
|
|
const std::string & |
value | |
|
) |
| | |
Sets the default value of a parameter.
- Parameters:
-
| parameterName | The name of the parameter to set the value of. |
| value | The new value for this parameter. |
- Returns:
- void
unsigned int tlp::ParameterDescriptionList::size |
( |
|
) |
const [inline] |