IHeader Class Referenceabstract

Base class for an OpenViBE header container. More...

Inherited by CHeader, and CHeaderAdapter.

Public Member Functions

virtual ~IHeader (void)
 Destructor.
 
General purpose functions
virtual void reset (void)=0
 Resets this header. More...
 
Experiment information
virtual OpenViBE::boolean setExperimentIdentifier (const OpenViBE::uint32 ui32ExperimentIdentifier)=0
 Sets the experiment identifier. More...
 
virtual OpenViBE::boolean setSubjectAge (const OpenViBE::uint32 ui32SubjectAge)=0
 Sets the subject age. More...
 
virtual OpenViBE::boolean setSubjectGender (const OpenViBE::uint32 ui32SubjectGender)=0
 Sets the subject gender. More...
 
virtual OpenViBE::uint32 getExperimentIdentifier (void) const =0
 Gets the experiment identifier. More...
 
virtual OpenViBE::uint32 getSubjectAge (void) const =0
 Gets the subject age. More...
 
virtual OpenViBE::uint32 getSubjectGender (void) const =0
 Gets the subject gender. More...
 
virtual OpenViBE::boolean isExperimentIdentifierSet (void) const =0
 Tests if experiment identifier has been set. More...
 
virtual OpenViBE::boolean isSubjectAgeSet (void) const =0
 Tests if subject age has been set. More...
 
virtual OpenViBE::boolean isSubjectGenderSet (void) const =0
 Tests if subject gender has been set. More...
 
virtual OpenViBE::boolean setImpedanceCheckRequested (const OpenViBE::boolean bImpedanceCheckRequested)=0
 
virtual OpenViBE::boolean isImpedanceCheckRequested (void) const =0
 
Chanel information
virtual OpenViBE::boolean setChannelCount (const OpenViBE::uint32 ui32ChannelCount)=0
 Sets channel count for the recorded signal. More...
 
virtual OpenViBE::boolean setChannelName (const OpenViBE::uint32 ui32ChannelIndex, const char *sChannelName)=0
 Sets a channel' name. More...
 
virtual OpenViBE::boolean setChannelGain (const OpenViBE::uint32 ui32ChannelIndex, const OpenViBE::float32 f32ChannelGain)=0
 Sets a channel' gain. More...
 
virtual OpenViBE::boolean setChannelUnits (const OpenViBE::uint32 ui32ChannelIndex, const OpenViBE::uint32 ui32ChannelUnit, const OpenViBE::uint32 ui32ChannelFactor)=0
 Sets a channel' measurement unit and its scaling factor. More...
 
virtual OpenViBE::uint32 getChannelCount (void) const =0
 Gets the number of channels for this header. More...
 
virtual const char * getChannelName (const OpenViBE::uint32 ui32ChannelIndex) const =0
 Gets the name of a channel. More...
 
virtual OpenViBE::float32 getChannelGain (const OpenViBE::uint32 ui32ChannelIndex) const =0
 Gets the gain of a channel. More...
 
virtual OpenViBE::boolean getChannelUnits (const OpenViBE::uint32 ui32ChannelIndex, OpenViBE::uint32 &ui32ChannelUnit, OpenViBE::uint32 &ui32ChannelFactor) const =0
 Gets a channel' measurement unit and its scaling factor. More...
 
virtual OpenViBE::boolean isChannelCountSet (void) const =0
 Tests if channel count has been set. More...
 
virtual OpenViBE::boolean isChannelNameSet (void) const =0
 Tests if channel name has been set at least once. More...
 
virtual OpenViBE::boolean isChannelGainSet (void) const =0
 Tests if channel gain has been set at least once. More...
 
virtual OpenViBE::boolean isChannelUnitSet (void) const =0
 Tests if channel unit has been set at least once. More...
 
Samples information
virtual OpenViBE::boolean setSamplingFrequency (const OpenViBE::uint32 ui32SamplingFrequency)=0
 Sets measured signal sampling rate. More...
 
virtual OpenViBE::uint32 getSamplingFrequency (void) const =0
 Gets the sampling rate of the measured signal. More...
 
virtual OpenViBE::boolean isSamplingFrequencySet (void) const =0
 Tests if sampling frequency has been set. More...
 

Detailed Description

Base class for an OpenViBE header container.

Author
Yann Renard (INRIA/IRISA)
Date
2007-04-01 IHeader objects are used by IDriver objects to give all the header information to the acquisition server. The IDriver developer may implement his own IHeader derived class or use the one provided with the acquisition server. To get a standard header, refer to the CHeader class.

The IHeader objects mainly consist in get/set/isSet functions that allow user code to modify, read back and check state of some single header information.

See Also
IDriver
IDriver::getHeader
CHeader

Member Function Documentation

virtual void reset ( void  )
pure virtual

Resets this header.

When called, this function resets all the header content to its default values. Most of the is*Set will return false after this call.

virtual OpenViBE::boolean setExperimentIdentifier ( const OpenViBE::uint32  ui32ExperimentIdentifier)
pure virtual

Sets the experiment identifier.

Parameters
ui32ExperimentIdentifier[in] : the experiment identifier to send to the OpenViBE platform.
Returns
true in case of success.
false in case of error.

The experiment identifier may be used by the platform to get details from a database, for example a description of the experiment, what is done, where etc...

virtual OpenViBE::boolean setSubjectAge ( const OpenViBE::uint32  ui32SubjectAge)
pure virtual

Sets the subject age.

Parameters
ui32SubjectAge[in] : the subject age in years
Returns
true in case of success.
false in case of error.
virtual OpenViBE::boolean setSubjectGender ( const OpenViBE::uint32  ui32SubjectGender)
pure virtual

Sets the subject gender.

Parameters
ui32SubjectGender[in] : the subject gender
Returns
true in case of success.
false in case of error.

The subject gender is given as an integer and should be ISO 5218 conformant... Allowed values are :

  • 0 : unknown
  • 1 : male
  • 2 : female
  • 3 : not specified
Note
This values are defined in the OpenViBE toolkit.
virtual OpenViBE::uint32 getExperimentIdentifier ( void  ) const
pure virtual

Gets the experiment identifier.

Returns
the experiement identifier.
See Also
setExperimentIdentifier
virtual OpenViBE::uint32 getSubjectAge ( void  ) const
pure virtual

Gets the subject age.

Returns
the subject age.
See Also
setSubjectAge
virtual OpenViBE::uint32 getSubjectGender ( void  ) const
pure virtual

Gets the subject gender.

Returns
the subject gender.
See Also
setSubjectGender
virtual OpenViBE::boolean isExperimentIdentifierSet ( void  ) const
pure virtual

Tests if experiment identifier has been set.

Returns
true if experiment identifier has been set since last reset.
false if experiment identifier has not been set.
See Also
setExperimentIdentifier
virtual OpenViBE::boolean isSubjectAgeSet ( void  ) const
pure virtual

Tests if subject age has been set.

Returns
true if the subject age has been set since last reset.
false if the subject age has not been set.
See Also
setSubjectAge
virtual OpenViBE::boolean isSubjectGenderSet ( void  ) const
pure virtual

Tests if subject gender has been set.

Returns
true if the subject gender has been set since last reset.
false if the subject gender has not been set.
See Also
setSubjectGender
virtual OpenViBE::boolean setChannelCount ( const OpenViBE::uint32  ui32ChannelCount)
pure virtual

Sets channel count for the recorded signal.

Parameters
ui32ChannelCount[in] : the number of the channel for the recorder signal
Returns
true in case of success.
false in case of error.

The number of channels will be used by the IDriver and the acquisition server to calculate the sample buffer size (that is nSamplesPerChannel x nChannel).

virtual OpenViBE::boolean setChannelName ( const OpenViBE::uint32  ui32ChannelIndex,
const char *  sChannelName 
)
pure virtual

Sets a channel' name.

Parameters
ui32ChannelIndex[in] : the index of the channel which name should be set
sChannelName[in] : the new name for this channel
Returns
true in case of success.
false in case of error.
Note
As soon as a channel name is set, all the yet-unset channel names are considered to be set to empty string.
virtual OpenViBE::boolean setChannelGain ( const OpenViBE::uint32  ui32ChannelIndex,
const OpenViBE::float32  f32ChannelGain 
)
pure virtual

Sets a channel' gain.

Parameters
ui32ChannelIndex[in] : the index of the channel which gain should be set
f32ChannelGain[in] : the gain value for this channel
Returns
true in case of success.
false in case of error.
Note
As soon as a channel gain is set, all the yet-unset channel gains are considered to be set to 1.

Gains are multiplicator coefficients that are used by the OpenViBE platform to to transform measured values into physical dimension.

virtual OpenViBE::boolean setChannelUnits ( const OpenViBE::uint32  ui32ChannelIndex,
const OpenViBE::uint32  ui32ChannelUnit,
const OpenViBE::uint32  ui32ChannelFactor 
)
pure virtual

Sets a channel' measurement unit and its scaling factor.

Parameters
ui32ChannelIndex[in] : the index of the channel which gain should be set
ui32ChannelUnit[in] : the unit
ui32ChannelFactor[in] : the scaling factor
Returns
true in case of success.
false in case of error.

Measurement units (e.g. Volts, Litres, ...) are specified by uint32 enums defined in the openvibe toolkit. Scaling factors (megas, millis, ...) are specified similarly. To specify that the channel is in millivolts, you set unit to volts and factor to millis. You get the list of supported enums from toolkit/ovtk_defines.h.

Default unit is 'Unspecified' and default factor is code translating 1e00.

virtual OpenViBE::uint32 getChannelCount ( void  ) const
pure virtual

Gets the number of channels for this header.

Todo:
setChannelLocation
Returns
the number of channels.
See Also
setChannelCount
virtual const char* getChannelName ( const OpenViBE::uint32  ui32ChannelIndex) const
pure virtual

Gets the name of a channel.

Parameters
ui32ChannelIndex[in] : the index of the channel which name is wanted
Returns
the name of the ui32ChannelIndex th channel if in the correct range and name has been specified.
an empty string if in the correct range but name has not been specified.
an empty string when ui32ChannelIndex is out of range.
See Also
setChannelName
virtual OpenViBE::float32 getChannelGain ( const OpenViBE::uint32  ui32ChannelIndex) const
pure virtual

Gets the gain of a channel.

Parameters
ui32ChannelIndex[in] : the index of the channel which gain is wanted
Returns
the gain of the ui32ChannelIndex th channel if in the correct range and gain has been specified.
1 if in the correct range but gain has not been specified.
0 when ui32ChannelIndex is out of range.
See Also
setChannelGain
virtual OpenViBE::boolean getChannelUnits ( const OpenViBE::uint32  ui32ChannelIndex,
OpenViBE::uint32 &  ui32ChannelUnit,
OpenViBE::uint32 &  ui32ChannelFactor 
) const
pure virtual

Gets a channel' measurement unit and its scaling factor.

Parameters
ui32ChannelIndex[in] : the index of the channel which gain should be set
ui32ChannelUnit[in] : the unit
ui32ChannelFactor[in] : the scaling factor
Returns
true in case of success.
false in case of error. On false, the outputs will be set to default values.

See setChannelUnits().

virtual OpenViBE::boolean isChannelCountSet ( void  ) const
pure virtual

Tests if channel count has been set.

Todo:
getChannelLocation
Returns
true if channel count has been set since last reset.
false if channel count has not been set.
See Also
setChannelCount
virtual OpenViBE::boolean isChannelNameSet ( void  ) const
pure virtual

Tests if channel name has been set at least once.

Returns
true if channel name has been set at least once since last reset.
false if channel name has not been set.
See Also
setChannelName
virtual OpenViBE::boolean isChannelGainSet ( void  ) const
pure virtual

Tests if channel gain has been set at least once.

Returns
true if channel gain has been set at least once since last reset.
false if channel gain has not been set.
See Also
setChannelGain
virtual OpenViBE::boolean isChannelUnitSet ( void  ) const
pure virtual

Tests if channel unit has been set at least once.

Todo:
isChannelLocationSet
Returns
true if channel unit has been set at least once since last reset.
false if channel unit has not been set.
See Also
setChannelGain
virtual OpenViBE::boolean setSamplingFrequency ( const OpenViBE::uint32  ui32SamplingFrequency)
pure virtual

Sets measured signal sampling rate.

Parameters
ui32SamplingFrequency[in] : the sampling rate for the measured signal
Returns
true in case of success.
false in case of error.
Note
the sampling rate is a global value. It can not be specified per channel.
virtual OpenViBE::uint32 getSamplingFrequency ( void  ) const
pure virtual

Gets the sampling rate of the measured signal.

Returns
the sampling rate of the measured signal
See Also
setSamplingFrequency
virtual OpenViBE::boolean isSamplingFrequencySet ( void  ) const
pure virtual

Tests if sampling frequency has been set.

Returns
true if sampling frequency has been set since last reset.
false if sampling frequency has not been set.
See Also
setSamplingFrequency