ITypeManager Class Referenceabstract

Type manager, provides information on platform's handled types, parameters, streams etc... More...

Inheritance diagram for ITypeManager:
IKernelObject IObject

Public Member Functions

Type registration
virtual OpenViBE::CIdentifier getNextTypeIdentifier (const OpenViBE::CIdentifier &rPreviousIdentifier) const =0
 Gets next type identifier. More...
 
virtual OpenViBE::boolean registerType (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sTypeName)=0
 Registers a new simple type of data. More...
 
virtual OpenViBE::boolean registerStreamType (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sTypeName, const OpenViBE::CIdentifier &rParentTypeIdentifier)=0
 Registers a new communication stream type. More...
 
virtual OpenViBE::boolean registerEnumerationType (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sTypeName)=0
 Registers a new enumeration type. More...
 
virtual OpenViBE::boolean registerEnumerationEntry (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sEntryName, const OpenViBE::uint64 ui64EntryValue)=0
 Registers a new enumeration value for a given enumeration type. More...
 
virtual OpenViBE::boolean registerBitMaskType (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sTypeName)=0
 Registers a new bitmask type. More...
 
virtual OpenViBE::boolean registerBitMaskEntry (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &sEntryName, const OpenViBE::uint64 ui64EntryValue)=0
 Registers a new bitmask value for a given bitmask type. More...
 
Registration verification
virtual OpenViBE::boolean isRegistered (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Tests if a specific type has been registered. More...
 
virtual OpenViBE::boolean isStream (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Tests if a specific type has been registered and is a stream. More...
 
virtual OpenViBE::boolean isDerivedFromStream (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CIdentifier &rParentTypeIdentifier) const =0
 Tests is a specific type has been registered, is a stream and is derived from another registered stream type. More...
 
virtual OpenViBE::boolean isEnumeration (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Tests if a specific type has been registered and is an enumeration. More...
 
virtual OpenViBE::boolean isBitMask (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Tests if a specific type has been registered and is a bitmask. More...
 
Type identification
virtual OpenViBE::CString getTypeName (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Gets the name of a specified type. More...
 
virtual OpenViBE::CIdentifier getStreamParentType (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Gets the parent stream type for a stream type. More...
 
Enumeration entry accessors
virtual OpenViBE::uint64 getEnumerationEntryCount (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Gets the number of enumeration entry for an enumeration type. More...
 
virtual OpenViBE::boolean getEnumerationEntry (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::uint64 ui64EntryIndex, OpenViBE::CString &sEntryName, OpenViBE::uint64 &rEntryValue) const =0
 Gets details for a specific enumeration type entry. More...
 
virtual OpenViBE::CString getEnumerationEntryNameFromValue (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::uint64 ui64EntryValue) const =0
 Converts an enumeration entry value to an enumeration entry name. More...
 
virtual OpenViBE::uint64 getEnumerationEntryValueFromName (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &rEntryName) const =0
 Converts an enumeration entry name to an enumeration entry value. More...
 
Bitmask entry accessors
virtual OpenViBE::uint64 getBitMaskEntryCount (const OpenViBE::CIdentifier &rTypeIdentifier) const =0
 Gets the number of bitmask entry for a bitmask type. More...
 
virtual OpenViBE::boolean getBitMaskEntry (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::uint64 ui64EntryIndex, OpenViBE::CString &sEntryName, OpenViBE::uint64 &rEntryValue) const =0
 Gets details for a specific bitmask type entry. More...
 
virtual OpenViBE::CString getBitMaskEntryNameFromValue (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::uint64 ui64EntryValue) const =0
 Converts a bitmask entry value to a bitmask entry name. More...
 
virtual OpenViBE::uint64 getBitMaskEntryValueFromName (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &rEntryName) const =0
 Converts a bitmask entry name to a bitmask entry value. More...
 
virtual OpenViBE::CString getBitMaskEntryCompositionNameFromValue (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::uint64 ui64EntryCompositionValue) const =0
 Computes the textual value of a composition of numerical entries. More...
 
virtual OpenViBE::uint64 getBitMaskEntryCompositionValueFromName (const OpenViBE::CIdentifier &rTypeIdentifier, const OpenViBE::CString &rEntryCompositionName) const =0
 Computes the integer value of a composition of textual entries. More...
 
virtual boolean evaluateSettingValue (const OpenViBE::CString settingValue, OpenViBE::float64 &numericResult) const =0
 Evaluate the string arithmetic expression settingValue to a numeric value as a float. More...
 
- Public Member Functions inherited from IObject
virtual OpenViBE::CIdentifier getClassIdentifier (void) const =0
 Returns the final class identifier of the concrete class. More...
 
virtual OpenViBE::boolean isDerivedFromClass (const OpenViBE::CIdentifier &rClassIdentifier) const
 Checks if this object is compatible with a class identifier. More...
 
virtual OpenViBE::boolean acceptVisitor (OpenViBE::IObjectVisitor &rObjectVisitor)
 Requests this object to accept a visitor. More...
 

Detailed Description

Type manager, provides information on platform's handled types, parameters, streams etc...

Author
Yann Renard (INRIA/IRISA)
Date
2007-03-14

This manager concentrates all information about types in the OpenViBE platform. Any non-standard type should be declared in the type identifier by the kernel or the plugins in order to be used. Registered types range from box settings to streams, eventually including inter-type auto casts.

See the different functions for more details.

Member Function Documentation

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

Gets next type identifier.

Parameters
rPreviousIdentifier[in] : The identifier for the preceeding type
Returns
The identifier of the next type in case of success.
OV_UndefinedIdentifier on error.
Note
Giving OV_UndefinedIdentifier as rPreviousIdentifier will cause this function to return the first type identifier.
virtual OpenViBE::boolean registerType ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sTypeName 
)
pure virtual

Registers a new simple type of data.

Parameters
rTypeIdentifier[in] : the identifier for this type
sTypeName[in] : the name for this type
Returns
true in case of success.
false in case of error.
virtual OpenViBE::boolean registerStreamType ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sTypeName,
const OpenViBE::CIdentifier rParentTypeIdentifier 
)
pure virtual

Registers a new communication stream type.

Parameters
rTypeIdentifier[in] : the identifier for this type
sTypeName[in] : the name for this type
rParentTypeIdentifier[in] : the parent stream type identifier
Returns
true in case of success.
false in case of error.

Stream types are organized as a hierarchy, meaning that any derived stream should at least contain the parent stream content, plus other informations. This will be used by applications in order to determine what stream is compatible with what other stream and to allow box connections or not.

virtual OpenViBE::boolean registerEnumerationType ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sTypeName 
)
pure virtual

Registers a new enumeration type.

Parameters
rTypeIdentifier[in] : the type identifier for this type
sTypeName[in] : the name for this type
Returns
true in case of success.
false in case of error.
See also
registerEnumerationEntry

An enumeration should have several possible values. This values have to be created thanks to registerEnumerationEntry

virtual OpenViBE::boolean registerEnumerationEntry ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sEntryName,
const OpenViBE::uint64  ui64EntryValue 
)
pure virtual

Registers a new enumeration value for a given enumeration type.

Parameters
rTypeIdentifier[in] : the type identifier of the enumeration which new entry has to be registered
sEntryName[in] : the name of the entry to register
ui64EntryValue[in] : the value of the entry to register
Returns
true in case of success.
false in case of error.
Note
the enumeration has to be registered
See also
registerEnumerationType
virtual OpenViBE::boolean registerBitMaskType ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sTypeName 
)
pure virtual

Registers a new bitmask type.

Parameters
rTypeIdentifier[in] : the type identifier for this type
sTypeName[in] : the name for this type
Returns
true in case of success.
false in case of error.
See also
registerBitMaskEntry

A bitmask should have several possible values. This values have to be created thanks to registerBitMaskEntry

virtual OpenViBE::boolean registerBitMaskEntry ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString sEntryName,
const OpenViBE::uint64  ui64EntryValue 
)
pure virtual

Registers a new bitmask value for a given bitmask type.

Parameters
rTypeIdentifier[in] : the type identifier of the bitmask which new entry has to be registered
sEntryName[in] : the name of the entry to register
ui64EntryValue[in] : the value of the entry to register
Returns
true in case of success.
false in case of error.
Note
the bitmask has to be registered
See also
registerBitMaskType
virtual OpenViBE::boolean isRegistered ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Tests if a specific type has been registered.

Parameters
rTypeIdentifier[in] : the type identifier which registration has to be tested
Returns
true if the specified type has been registered.
false if the specified type has not been registered.
virtual OpenViBE::boolean isStream ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Tests if a specific type has been registered and is a stream.

Parameters
rTypeIdentifier[in] : the type identifier which registration has to be tested
Returns
true if the specified type has been registered is a stream.
false if the specified type has not been registered or is not a stream.
virtual OpenViBE::boolean isDerivedFromStream ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CIdentifier rParentTypeIdentifier 
) const
pure virtual

Tests is a specific type has been registered, is a stream and is derived from another registered stream type.

Parameters
rTypeIdentifier[in] : the type identifier which registration and derivation has to be tested
rParentTypeIdentifier[in] : the type identifier of the supposed parent stream
Returns
true in case rTypeIdentifier is registered as a stream type and derived from rParentTypeIdentifier
false in case rParentTypeIdentifier is not registered
false in case rParentTypeIdentifier is not a stream
false in case rTypeIdentifier is not registered
false in case rTypeIdentifier is not a stream
false in case rTypeIdentifier is not derived from rParentTypeIdentifier
Note
The derivation can be indirect (rTypeIdentifier can derive an intermediate stream type which derives rParentTypeIdentifier)
virtual OpenViBE::boolean isEnumeration ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Tests if a specific type has been registered and is an enumeration.

Parameters
rTypeIdentifier[in] : the type identifier which registration has to be tested
Returns
true if the specified type has been registered and is an enumeration.
false if the specified type has not been registered or is not an enumeration.
virtual OpenViBE::boolean isBitMask ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Tests if a specific type has been registered and is a bitmask.

Parameters
rTypeIdentifier[in] : the type identifier which registration has to be tested
Returns
true if the specified type has been registered and is a bitmask.
false if the specified type has not been registered or is not a bitmask.
virtual OpenViBE::CString getTypeName ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Gets the name of a specified type.

Parameters
rTypeIdentifier[in] : the type identifier which name should be returned
Returns
the name of the speficied type.
virtual OpenViBE::CIdentifier getStreamParentType ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Gets the parent stream type for a stream type.

Parameters
rTypeIdentifier[in] : the stream type identifier which parent stream type be returned
Returns
the parent stream type on success.
OV_UndefinedIdentifier on error.
Note
The specified type identifier has to be a stream type.
virtual OpenViBE::uint64 getEnumerationEntryCount ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Gets the number of enumeration entry for an enumeration type.

Parameters
rTypeIdentifier[in] : the enumeration type identifier
Returns
the number of entry for this enumeration type.
virtual OpenViBE::boolean getEnumerationEntry ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::uint64  ui64EntryIndex,
OpenViBE::CString sEntryName,
OpenViBE::uint64 &  rEntryValue 
) const
pure virtual

Gets details for a specific enumeration type entry.

Parameters
rTypeIdentifier[in] : the enumeration type identifier
ui64EntryIndex[in] : the index of the entry which details should be returned
sEntryName[out] : the name of the specified entry
rEntryValue[out] : the value of the speficied entry
Returns
true in case of success.
false in case of error.
virtual OpenViBE::CString getEnumerationEntryNameFromValue ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::uint64  ui64EntryValue 
) const
pure virtual

Converts an enumeration entry value to an enumeration entry name.

Parameters
rTypeIdentifier[in] : the enumeration type identifier
ui64EntryValue[in] : the enumeration entry value
Returns
the enumeration entry name corresponding to the specified value.
Warning
on error, an empty string is returned.
virtual OpenViBE::uint64 getEnumerationEntryValueFromName ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString rEntryName 
) const
pure virtual

Converts an enumeration entry name to an enumeration entry value.

Parameters
rTypeIdentifier[in] : the enumeration type identifier
rEntryName[in] : the enumeration entry name
Returns
the enumeration entry value corresponding to the specified name.
Warning
on error, 0xffffffffffffffffLL is returned.
virtual OpenViBE::uint64 getBitMaskEntryCount ( const OpenViBE::CIdentifier rTypeIdentifier) const
pure virtual

Gets the number of bitmask entry for a bitmask type.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
Returns
the number of entry for this bitmask type.
virtual OpenViBE::boolean getBitMaskEntry ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::uint64  ui64EntryIndex,
OpenViBE::CString sEntryName,
OpenViBE::uint64 &  rEntryValue 
) const
pure virtual

Gets details for a specific bitmask type entry.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
ui64EntryIndex[in] : the index of the entry which details should be returned
sEntryName[out] : the name of the specified entry
rEntryValue[out] : the value of the speficied entry
Returns
true in case of success.
false in case of error.
virtual OpenViBE::CString getBitMaskEntryNameFromValue ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::uint64  ui64EntryValue 
) const
pure virtual

Converts a bitmask entry value to a bitmask entry name.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
ui64EntryValue[in] : the bitmask entry value
Returns
the bitmask entry name corresponding to the specified value.
Warning
on error, an empty string is returned.
virtual OpenViBE::uint64 getBitMaskEntryValueFromName ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString rEntryName 
) const
pure virtual

Converts a bitmask entry name to a bitmask entry value.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
rEntryName[in] : the bitmask entry name
Returns
the bitmask entry value corresponding to the specified name.
Warning
on error, 0xffffffffffffffffLL is returned.
virtual OpenViBE::CString getBitMaskEntryCompositionNameFromValue ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::uint64  ui64EntryCompositionValue 
) const
pure virtual

Computes the textual value of a composition of numerical entries.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
ui64EntryCompositionValue[in] : the composition of numerical entries
Returns
the bitmask entry composition name.
Warning
on error, an empty string is returned.
virtual OpenViBE::uint64 getBitMaskEntryCompositionValueFromName ( const OpenViBE::CIdentifier rTypeIdentifier,
const OpenViBE::CString rEntryCompositionName 
) const
pure virtual

Computes the integer value of a composition of textual entries.

Parameters
rTypeIdentifier[in] : the bitmask type identifier
rEntryCompositionName[in] : the composition of textual entries
Returns
the bitmask entry composition value.
Warning
on error, 0x0000000000000000LL is returned.
virtual boolean evaluateSettingValue ( const OpenViBE::CString  settingValue,
OpenViBE::float64 &  numericResult 
) const
pure virtual

Evaluate the string arithmetic expression settingValue to a numeric value as a float.

Parameters
settingValue[in] : arithmetic expression to evaluate
numericResult[out] : result of evaluation
Returns
true if the arithmetic evaluation succeeded,
false if the arithmetic expression is incorrect