ParameterSettable Class Reference
The base for classes that can be configured/saved using a ConfigurationParameters object. More...

Classes | |
class | BoolDescriptor |
Utility Class for customize the description of Boolean parameter. More... | |
class | Descriptor |
Utility Class for describe the parameters of a ParameterSettable. More... | |
class | EnumDescriptor |
Utility Class for customize the description of Enum-like parameter. More... | |
class | IntDescriptor |
Utility Class for customize the description of Integer parameter. More... | |
class | ObjectDescriptor |
Utility Class for customize the description of an object parameter. More... | |
class | RealDescriptor |
Utility Class for customize the description of Real valued parameter. More... | |
class | StringDescriptor |
Utility Class for customize the description of String parameter. More... | |
class | SubgroupDescriptor |
Utility Class for customize the description of a subgroup. More... | |
Public Types | |
enum | Property { Default = 0x0000, IsList = 0x0001, IsMandatory = 0x0002, AllowMultiple = 0x0004 } |
this enum is used to describe the properties of a parameter or a subgroup in a type description More... | |
Public Member Functions | |
ParameterSettable () | |
Constructor. | |
virtual | ~ParameterSettable () |
Destructor. | |
virtual void | postConfigureInitialization () |
This function is called after all linked objects have been configured. | |
QList< RuntimeParameterSetter * > | runtimeParameterList () |
return the complet list of all parameter marked as runtime modifiable | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix)=0 |
Saves the actual status of parameters into the ConfigurationParameters object passed. | |
void | setRuntimeParameter (QString paramFullPath, unsigned int newvalue) |
set the value of an unsigned integer parameter previously marked as runtime modifiable | |
void | setRuntimeParameter (QString paramFullPath, bool newvalue) |
set the value of a boolean parameter previously marked as runtime modifiable | |
void | setRuntimeParameter (QString paramFullPath, int newvalue) |
set the value of an integer parameter previously marked as runtime modifiable | |
void | setRuntimeParameter (QString paramFullPath, double newvalue) |
set the value of a double parameter previously marked as runtime modifiable | |
void | setRuntimeParameter (QString paramFullPath, float newvalue) |
set the value of a float parameter previously marked as runtime modifiable | |
Static Public Member Functions | |
static void | describe (QString type) |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups. | |
Static Public Attributes | |
static const double | Infinity = std::numeric_limits<double>::infinity() |
Shortcut variable for indicate an infinity double number. | |
static const int | MaxInteger = std::numeric_limits<int>::max() |
Shortcut variable for indicate the maximum int value allowed. | |
static const int | MinInteger = std::numeric_limits<int>::min() |
Shortcut variable for indicate the minimum int value allowed. | |
Protected Member Functions | |
void | markParameterAsRuntime (QString paramName, int *paramPointer) |
mark a parameter as modifiable at runtime bypassing the configure method | |
template<class T > | |
void | markParameterAsRuntime (QString paramName, T *paramOwner, void(T::*setterMethod)(bool), bool(T::*getterMethod)() const ) |
mark a parameter as modifiable at runtime bypassing the configure method | |
template<class T > | |
void | markParameterAsRuntime (QString paramName, T *paramOwner, void(T::*setterMethod)(float), float(T::*getterMethod)() const ) |
mark a parameter as modifiable at runtime bypassing the configure method | |
template<class T > | |
void | markParameterAsRuntime (QString paramName, T *paramOwner, void(T::*setterMethod)(double), double(T::*getterMethod)() const ) |
mark a parameter as modifiable at runtime bypassing the configure method | |
template<class T > | |
void | markParameterAsRuntime (QString paramName, T *paramOwner, void(T::*setterMethod)(unsigned int), unsigned int(T::*getterMethod)() const ) |
mark a parameter as modifiable at runtime bypassing the configure method | |
template<class T > | |
void | markParameterAsRuntime (QString paramName, T *paramOwner, void(T::*setterMethod)(int), int(T::*getterMethod)() const ) |
mark a parameter as modifiable at runtime bypassing the configure method | |
void | markParameterAsRuntime (QString paramName, bool *paramPointer) |
mark a parameter as modifiable at runtime bypassing the configure method | |
void | markParameterAsRuntime (QString paramName, double *paramPointer) |
mark a parameter as modifiable at runtime bypassing the configure method | |
void | markParameterAsRuntime (QString paramName, unsigned int *paramPointer) |
mark a parameter as modifiable at runtime bypassing the configure method | |
Static Protected Member Functions | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
Add an entry for the type into the descriptions of all available types. |
Detailed Description
The base for classes that can be configured/saved using a ConfigurationParameters object.
This is also the abstract product of the factory methods.
- Note:
- This lacks any method to configure the object. ALWAYS use one of the two subclasses below.
- Warning:
- All classes that have ParameterSettable as an ancestor should be only created and configured using ConfigurationParameters. Calling configure() or postConfigureInitialization() by hand is highly discouraged (you could experience strange problems...)
Definition at line 48 of file parametersettable.h.
Member Enumeration Documentation
enum Property |
this enum is used to describe the properties of a parameter or a subgroup in a type description
The properties of a parameter of a subgroup are specified using one or ORing two or more descriptionProperties enumeration. For example: AllowMultiple | isMandatory correspond a flag that specify a parameter that is a list of values and that is mandatory
- Enumerator:
Definition at line 57 of file parametersettable.h.
Constructor & Destructor Documentation
ParameterSettable | ( | ) | [inline] |
Constructor.
Definition at line 82 of file parametersettable.h.
virtual ~ParameterSettable | ( | ) | [inline, virtual] |
Destructor.
Definition at line 89 of file parametersettable.h.
Member Function Documentation
ParameterSettable::Descriptor addTypeDescription | ( | QString | type, |
QString | shortHelp, | ||
QString | longHelp = QString("") |
||
) | [static, protected] |
Add an entry for the type into the descriptions of all available types.
This method will return an instance of Descriptor for describe the parameters and subgroups of the type. Use the methods Descriptor::describeXxx to declare the parameters and subgroups available for configuring the type
- Returns:
- an instance of Descriptor to use for adding description of the parameters of the type to describe
- Parameters:
-
type is the name of the type shortHelp is the short comment (rich text here is not allowed) longHelp is the long help (rich text here is allowed); if not specified the longHelp will be the same of the shortHelp
- Note:
- always add the type description with a shortHelp (and possibly a longer help) even in the case the type has no parameters or subgroups
Definition at line 143 of file parametersettable.cpp.
static void describe | ( | QString | type | ) | [inline, static] |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
It's mandatory in all subclasses where configure and save methods have been re-implemented for dealing with new parameters and subgroups to also implement the describe method
- Parameters:
-
type is the name of the type regarding the description. The type is used when a subclass reuse the description of its parent calling the parent describe method passing the type of the subclass. In this way, the result of the method describe of the parent will be the addition of the description of the parameters of the parent class into the type of the subclass
Definition at line 115 of file parametersettable.h.
void markParameterAsRuntime | ( | QString | paramName, |
T * | paramOwner, | ||
void(T::*)(bool) | setterMethod, | ||
bool(T::*)() const | getterMethod | ||
) | [inline, protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramOwner is the object on which the setterMethod belongs setterMethod is the pointer-to-member to the method used for setting the value of the parameter; it must accept one bool argument and return void getterMethod is the pointer-to-member to the method used for getting the value of the parameter; it must accept no arguments and return bool
Definition at line 289 of file parametersettable.h.
void markParameterAsRuntime | ( | QString | paramName, |
int * | paramPointer | ||
) | [protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramPointer is the pointer to the value of the parameter; setRuntimeParameter will change the the value pointed by paramPointer
Definition at line 126 of file parametersettable.cpp.
Referenced by ParameterSettable::markParameterAsRuntime().
void markParameterAsRuntime | ( | QString | paramName, |
T * | paramOwner, | ||
void(T::*)(float) | setterMethod, | ||
float(T::*)() const | getterMethod | ||
) | [inline, protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramOwner is the object on which the setterMethod belongs setterMethod is the pointer-to-member to the method used for setting the value of the parameter; it must accept one float argument and return void getterMethod is the pointer-to-member to the method used for getting the value of the parameter; it must accept no arguments and return float
Definition at line 274 of file parametersettable.h.
void markParameterAsRuntime | ( | QString | paramName, |
T * | paramOwner, | ||
void(T::*)(unsigned int) | setterMethod, | ||
unsigned int(T::*)() const | getterMethod | ||
) | [inline, protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramOwner is the object on which the setterMethod belongs setterMethod is the pointer-to-member to the method used for setting the value of the parameter; it must accept one 'unsigned int' argument and return void getterMethod is the pointer-to-member to the method used for getting the value of the parameter; it must accept no arguments and return 'unsigned int'
Definition at line 244 of file parametersettable.h.
void markParameterAsRuntime | ( | QString | paramName, |
T * | paramOwner, | ||
void(T::*)(double) | setterMethod, | ||
double(T::*)() const | getterMethod | ||
) | [inline, protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramOwner is the object on which the setterMethod belongs setterMethod is the pointer-to-member to the method used for setting the value of the parameter; it must accept one double argument and return void getterMethod is the pointer-to-member to the method used for getting the value of the parameter; it must accept no arguments and return double
Definition at line 259 of file parametersettable.h.
void markParameterAsRuntime | ( | QString | paramName, |
unsigned int * | paramPointer | ||
) | [protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramPointer is the pointer to the value of the parameter; setRuntimeParameter will change the the value pointed by paramPointer
void markParameterAsRuntime | ( | QString | paramName, |
double * | paramPointer | ||
) | [protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramPointer is the pointer to the value of the parameter; setRuntimeParameter will change the the value pointed by paramPointer
Definition at line 130 of file parametersettable.cpp.
References ParameterSettable::markParameterAsRuntime().
void markParameterAsRuntime | ( | QString | paramName, |
bool * | paramPointer | ||
) | [protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramPointer is the pointer to the value of the parameter; setRuntimeParameter will change the the value pointed by paramPointer
Definition at line 134 of file parametersettable.cpp.
References ParameterSettable::markParameterAsRuntime().
void markParameterAsRuntime | ( | QString | paramName, |
T * | paramOwner, | ||
void(T::*)(int) | setterMethod, | ||
int(T::*)() const | getterMethod | ||
) | [inline, protected] |
mark a parameter as modifiable at runtime bypassing the configure method
When a parameter is marked as runtime modifiable, it means that the value of the parameter can be changed in any moment using the setRuntimeParameter method bypassing the configure method.
- Parameters:
-
paramName is the name of the parameter paramOwner is the object on which the setterMethod belongs setterMethod is the pointer-to-member to the method used for setting the value of the parameter; it must accept one int argument and return void getterMethod is the pointer-to-member to the method used for getting the value of the parameter; it must accept no arguments and return int
Definition at line 229 of file parametersettable.h.
virtual void postConfigureInitialization | ( | ) | [inline, virtual] |
This function is called after all linked objects have been configured.
See the description of the ConfigurationParameters class for more information. The default implementation does nothing
Definition at line 124 of file parametersettable.h.
QList< RuntimeParameterSetter * > runtimeParameterList | ( | ) |
return the complet list of all parameter marked as runtime modifiable
Definition at line 122 of file parametersettable.cpp.
virtual void save | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [pure virtual] |
Saves the actual status of parameters into the ConfigurationParameters object passed.
- Parameters:
-
params the configuration parameters object on which save actual parameters prefix the prefix to use to access the object configuration parameters.
void setRuntimeParameter | ( | QString | paramFullPath, |
double | newvalue | ||
) |
set the value of a double parameter previously marked as runtime modifiable
- Parameters:
-
paramFullPath is the full path of the parameter that identify it newvalue is the new value to assign to the parameter
- Note:
- the changes made by this method are never reflected to any ConfigurationParameters used during the call of configure method
- Warning:
- this method will raise an exception if the parameter is not marked as runtime modifiable
- this method will raise an exception if the type mismatch
Definition at line 95 of file parametersettable.cpp.
References RuntimeParameterSetter::set().
void setRuntimeParameter | ( | QString | paramFullPath, |
int | newvalue | ||
) |
set the value of an integer parameter previously marked as runtime modifiable
- Parameters:
-
paramFullPath is the full path of the parameter that identify it newvalue is the new value to assign to the parameter
- Note:
- the changes made by this method are never reflected to any ConfigurationParameters used during the call of configure method
- Warning:
- this method will raise an exception if the parameter is not marked as runtime modifiable
- this method will raise an exception if the type mismatch
Definition at line 77 of file parametersettable.cpp.
References RuntimeParameterSetter::set().
void setRuntimeParameter | ( | QString | paramFullPath, |
bool | newvalue | ||
) |
set the value of a boolean parameter previously marked as runtime modifiable
- Parameters:
-
paramFullPath is the full path of the parameter that identify it newvalue is the new value to assign to the parameter
- Note:
- the changes made by this method are never reflected to any ConfigurationParameters used during the call of configure method
- Warning:
- this method will raise an exception if the parameter is not marked as runtime modifiable
- this method will raise an exception if the type mismatch
Definition at line 113 of file parametersettable.cpp.
References RuntimeParameterSetter::set().
void setRuntimeParameter | ( | QString | paramFullPath, |
unsigned int | newvalue | ||
) |
set the value of an unsigned integer parameter previously marked as runtime modifiable
- Parameters:
-
paramFullPath is the full path of the parameter that identify it newvalue is the new value to assign to the parameter
- Note:
- the changes made by this method are never reflected to any ConfigurationParameters used during the call of configure method
- Warning:
- this method will raise an exception if the parameter is not marked as runtime modifiable
- this method will raise an exception if the type mismatch
Definition at line 86 of file parametersettable.cpp.
References RuntimeParameterSetter::set().
void setRuntimeParameter | ( | QString | paramFullPath, |
float | newvalue | ||
) |
set the value of a float parameter previously marked as runtime modifiable
- Parameters:
-
paramFullPath is the full path of the parameter that identify it newvalue is the new value to assign to the parameter
- Note:
- the changes made by this method are never reflected to any ConfigurationParameters used during the call of configure method
- Warning:
- this method will raise an exception if the parameter is not marked as runtime modifiable
- this method will raise an exception if the type mismatch
Definition at line 104 of file parametersettable.cpp.
References RuntimeParameterSetter::set().
Member Data Documentation
const double Infinity = std::numeric_limits<double>::infinity() [static] |
Shortcut variable for indicate an infinity double number.
Definition at line 73 of file parametersettable.h.
Referenced by ParameterSettable::RealDescriptor::limits().
const int MaxInteger = std::numeric_limits<int>::max() [static] |
Shortcut variable for indicate the maximum int value allowed.
Definition at line 75 of file parametersettable.h.
Referenced by ParameterSettable::IntDescriptor::limits().
const int MinInteger = std::numeric_limits<int>::min() [static] |
Shortcut variable for indicate the minimum int value allowed.
Definition at line 77 of file parametersettable.h.
Referenced by ParameterSettable::IntDescriptor::limits().
The documentation for this class was generated from the following files:
- configuration/include/parametersettable.h
- configuration/src/parametersettable.cpp