IHeader Class Reference

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

Inherited by CHeader, and CHeaderAdapter.

List of all members.

Public Member Functions

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

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 dimmension.

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 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 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