IParameter Class Reference

Generic parameter handler for configurable objects. More...

Inheritance diagram for IParameter:
IKernelObject IObject

Public Member Functions

information
virtual OpenViBE::uint64 getParameterSize (void) const
 Gets the size of this parameter's content.
virtual
OpenViBE::Kernel::EParameterType 
getType (void) const
 Gets the type of this parameter's content.
virtual OpenViBE::CIdentifier getSubTypeIdentifier (void) const
 Gets the sub type of this parameter's content (e.g. for enumeration)
Reinitialization
virtual OpenViBE::boolean clearReferenceTarget (void)
 Clears all reference targets for this paramter.
Reference target management
virtual OpenViBE::boolean getReferenceTarget (OpenViBE::Kernel::IParameter *&value) const
 Gets the parameter reference target.
virtual OpenViBE::boolean setReferenceTarget (OpenViBE::Kernel::IParameter *value)
 Sets the parameter reference target for this parameter.
virtual OpenViBE::boolean getReferenceTarget (void *value) const
 Gets the value reference target.
virtual OpenViBE::boolean setReferenceTarget (const void *value)
 Sets the value reference target for this parameter.
Value access
virtual OpenViBE::boolean getValue (void *value) const
 Gets the value for this parameter.
virtual OpenViBE::boolean setValue (const void *value)
 Sets the value for this parameter.

Detailed Description

Generic parameter handler for configurable objects.

Author
Yann Renard (INRIA/IRISA)
Date
2007-11-21
See Also
IConfigurable
EParameterType
TParameterHandler

Instances of this interface encapsulate a specific type of object as a so called "parameter". The idea behind this parameter interface is to allow to override the parameter content directly pointing to another parameter or another value. In order to be as generic as possible, this interface uses void* pointers in conjunction with data size values. It can be hard/tricky to understand for unexperienced developers. Thus I recommend the use of the TParameterHandler object which dramatically eases the use of the IParameter interface.

Member Function Documentation

virtual OpenViBE::uint64 getParameterSize ( void  ) const
inlinevirtual

Gets the size of this parameter's content.

Returns
the size of this parameter's content.
virtual OpenViBE::Kernel::EParameterType getType ( void  ) const
inlinevirtual

Gets the type of this parameter's content.

Returns
the type of this parameter's content.

References OpenViBE::Kernel::ParameterType_None.

virtual OpenViBE::CIdentifier getSubTypeIdentifier ( void  ) const
inlinevirtual

Gets the sub type of this parameter's content (e.g. for enumeration)

Returns
the sub type of this parameter's content (e.g. for enumeration).
virtual OpenViBE::boolean clearReferenceTarget ( void  )
inlinevirtual

Clears all reference targets for this paramter.

Returns
true in case of success.
false in case of error.
See Also
getReferenceTarget
setReferenceTarget

Referenced by TParameterHandler< OpenViBE::IStimulationSet * >::clearReferenceTarget().

virtual OpenViBE::boolean getReferenceTarget ( OpenViBE::Kernel::IParameter *&  value) const
inlinevirtual

Gets the parameter reference target.

Parameters
value[out] : a pointer to the reference target parameter if existing, NULL if not
Returns
true in case of success.
false in case of error.
virtual OpenViBE::boolean setReferenceTarget ( OpenViBE::Kernel::IParameter value)
inlinevirtual

Sets the parameter reference target for this parameter.

Parameters
value[in] : the new reference target to use
Returns
true in case of success.
false in case of error.
Note
Setting NULL simply removes the parameter reference target
Warning
calling this function overrives previous value reference target !

After this function has been called, any call to getValue or setValue will be directly redirected to the specified reference target parameter. The internal value handled by this parameter won't be affected anymore until the reference target is cleared.

Referenced by TParameterHandler< OpenViBE::IStimulationSet * >::setReferenceTarget().

virtual OpenViBE::boolean getReferenceTarget ( void *  value) const
inlinevirtual

Gets the value reference target.

Parameters
value[out] : a pointer to the value target parameter if existing, NULL if not
Returns
true in case of success.
false in case of error.
virtual OpenViBE::boolean setReferenceTarget ( const void *  value)
inlinevirtual

Sets the value reference target for this parameter.

Parameters
value[in] : the new reference target to use
Returns
true in case of success.
false in case of error.
Note
Setting NULL simply removes the value reference target
Warning
calling this function overrives previous parameter reference target !

After this function has been called, any call to getValue or setValue will be directly redirected to the specified value reference target. The internal value handled by this parameter won't be affected anymore until the reference target is cleared.

virtual OpenViBE::boolean getValue ( void *  value) const
inlinevirtual

Gets the value for this parameter.

Parameters
value[out] : a pointer to where the value should be copied
Returns
true in case of success.
false in case of error.
Note
the function assumes enough memory has been allocated in value to copy the value itself.
if a parameter or value reference target has been created, then either this target's getValue is automatically called, either the value target is directly copied
See Also
getParameterSize

Referenced by TParameterHandler< T >::operator T(), and TParameterHandler< OpenViBE::IStimulationSet * >::operator->().

virtual OpenViBE::boolean setValue ( const void *  value)
inlinevirtual

Sets the value for this parameter.

Parameters
value[in] : a pointer from where the value should be copied
Returns
true in case of success.
false in case of error.
See Also
getParameterSize

Referenced by TParameterHandler< OpenViBE::IStimulationSet * >::operator=().