IConfigurable Class Referenceabstract

Configurable object interface. More...

Inherits IKernelObject.

Public Member Functions

virtual OpenViBE::CIdentifier getNextParameterIdentifier (const OpenViBE::CIdentifier &rPreviousIdentifier) const =0
 Enumerates parameter identifiers for this configurable. More...
 
virtual
OpenViBE::Kernel::IParameter
getParameter (const OpenViBE::CIdentifier &rParameterIdentifier)=0
 Gets a specific parameter given its identifier. More...
 
virtual OpenViBE::boolean setParameter (const OpenViBE::CIdentifier &rParameterIdentifier, OpenViBE::Kernel::IParameter &rpParameter)=0
 Replaces the parameter with a client handled object. More...
 
virtual
OpenViBE::Kernel::IParameter
createParameter (const OpenViBE::CIdentifier &rParameterIdentifier, const OpenViBE::Kernel::EParameterType eParameterType, const OpenViBE::CIdentifier &rSubTypeIdentifier=OV_UndefinedIdentifier)=0
 Creates a new parameter of a specific type. More...
 
virtual OpenViBE::boolean removeParameter (const OpenViBE::CIdentifier &rParameterIdentifier)=0
 Removes an existing parameter. More...
 

Detailed Description

Configurable object interface.

Author
Yann Renard (INRIA/IRISA)
Date
2007-11-21
See Also
IParameter

An instance of this class is able to self create several type of parameters in order to be used by external code. The parameter handling is very abstract but its use is made easier thanks to the parameter handler. See IParameter and TParameterHandler for more details.

Member Function Documentation

virtual OpenViBE::CIdentifier getNextParameterIdentifier ( const OpenViBE::CIdentifier rPreviousIdentifier) const
pure virtual

Enumerates parameter identifiers for this configurable.

Parameters
rPreviousIdentifier[in] : the identifier which next identifier has to be returned
Returns
the parameter identifier following the provided parameter identifier.
Note
if rPreviousIdentifier is OV_UndefinedIdentifier , the first parameter identifier is returned
getting OV_UndefinedIdentifier has result means there are no more identifier after rPreviousIdentifier

Sample code to iterate on parameter identifiers :

IConfigurable* l_pConfigurable= // ...
CIdentifier l_oCurrentIdentifier=OV_UndefinedIdentifier;
while((l_oCurrentIdentifier=l_pConfigurable->getNextParameterIdentifier(l_oCurrentIdentifier))!=OV_UndefinedIdentifier)
{
IParameter* l_pParameter=l_pConfigurable->getParameter(l_oCurrentIdentifier);
// ...
}
virtual OpenViBE::Kernel::IParameter* getParameter ( const OpenViBE::CIdentifier rParameterIdentifier)
pure virtual

Gets a specific parameter given its identifier.

Parameters
rParameterIdentifier[in] : the identifier of the parameter to get
Returns
a pointer to the corresponding parameter in case of success.
NULL in case of error.
virtual OpenViBE::boolean setParameter ( const OpenViBE::CIdentifier rParameterIdentifier,
OpenViBE::Kernel::IParameter rpParameter 
)
pure virtual

Replaces the parameter with a client handled object.

Parameters
rParameterIdentifier[in] : the identifier of the parameter to replace
rpParameter[in] : the parameter object to put in place of the old parameter
Returns
true in case of success.
false in case of error.
Note
The parameter should have been created before and should exist.
Even if a new paramter is affected to a configurable, the memory management of this parameter remains to the responsability of the client code. Thus none of removeParameter nor configurable destruction will release this parameter object. The caller should take care of this when needed.
virtual OpenViBE::Kernel::IParameter* createParameter ( const OpenViBE::CIdentifier rParameterIdentifier,
const OpenViBE::Kernel::EParameterType  eParameterType,
const OpenViBE::CIdentifier rSubTypeIdentifier = OV_UndefinedIdentifier 
)
pure virtual

Creates a new parameter of a specific type.

Parameters
rParameterIdentifier[in] : the parameter identifier which has to be created
eParameterType[in] : the type of this parameter
rSubTypeIdentifier[in] : the optional sub type of this parameter (e.g. for enumerations)
See Also
EParameterType
IParameter

This function creates a new parameter with its associated object.

virtual OpenViBE::boolean removeParameter ( const OpenViBE::CIdentifier rParameterIdentifier)
pure virtual

Removes an existing parameter.

Parameters
rParameterIdentifier[in] : the identifier of the parameter to remove
Returns
true in case of success
false in case of error
Note
if the parameter object is not released if it was replaced by a custom parameter object thanks to setParameter function.