CIdentifier Class Reference

Globally used identifiaction classThis class is the basic class to use in order to identify objects in the OpenViBE platform. It can be used for class identification, for object identification and any user needed identification process. More...

List of all members.

Public Member Functions

OpenViBE::CString toString (void) const
 Converts this identifier into an OpenViBE string.
OpenViBE::boolean fromString (const OpenViBE::CString &rString)
 Reads a an OpenViBE string to extract this identifier.
OpenViBE::uint64 toUInteger (void) const
 Converts this identifier into an unsigned 64 bits integer.
Constructors
 CIdentifier (void)
 Default constructor.
 CIdentifier (const OpenViBE::uint32 ui32Identifier1, const OpenViBE::uint32 ui32Identifier2)
 32 bits integer based constructor
 CIdentifier (const OpenViBE::uint64 ui64Identifier)
 64 bits integer based constructor
 CIdentifier (const OpenViBE::CIdentifier &rIdentifier)
 Copy constructor.

Static Public Member Functions

static OpenViBE::CIdentifier random (void)
 Creates a random identifier.

Protected Attributes

OpenViBE::uint64 m_ui64Identifier
 the 64 bit identifier value

Operators

OpenViBE::CIdentifieroperator= (const OpenViBE::CIdentifier &rIdentifier)
 Affectation operator.
OpenViBE::CIdentifieroperator++ (void)
 Increments this identifier by 1.
OpenViBE::CIdentifieroperator-- (void)
 Decrements this identifier by 1.
OV_API OpenViBE::boolean operator== (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Equality test operator.
OV_API OpenViBE::boolean operator!= (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Difference test operator.
OV_API OpenViBE::boolean operator< (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Order test operator.
OV_API OpenViBE::boolean operator> (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Order test operator.
OV_API OpenViBE::boolean operator<= (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Order test operator.
OV_API OpenViBE::boolean operator>= (const OpenViBE::CIdentifier &rIdentifier1, const OpenViBE::CIdentifier &rIdentifier2)
 Order test operator.

Detailed Description

Globally used identifiaction class

This class is the basic class to use in order to identify objects in the OpenViBE platform. It can be used for class identification, for object identification and any user needed identification process.

Author:
Yann Renard (INRIA/IRISA)
Date:
2006-06-16 The identification of the OpenViBE platform is based on 64 bits integers. This allows more than 1 800 000 000 000 000 000 identifiers to exist... I won't write that this should be enough ;) (this is (c) Bill Gates) but at least... it may fit our today needs !

This class is heavily used in the OpenViBE::IObject class. Also, the OpenViBE specification gives serveral already defined class identifiers the developper should know of. For this, let you have a look to the documentation of ov_defines.h !

See also:
ov_defines.h

Constructor & Destructor Documentation

CIdentifier ( void  )

Default constructor.

Builds up the 64 bits identifier intialized to OV_UndefinedIdentifier.

CIdentifier ( const OpenViBE::uint32  ui32Identifier1,
const OpenViBE::uint32  ui32Identifier2 
)

32 bits integer based constructor

Parameters:
ui32Identifier1[in] : the first part of the identifier
ui32Identifier2[in] : the second part of the identifier

Builds up the 64 bits identifier given its two 32 bits components.

CIdentifier ( const OpenViBE::uint64  ui64Identifier)

64 bits integer based constructor

Parameters:
ui64Identifier[in] : The identifier
CIdentifier ( const OpenViBE::CIdentifier rIdentifier)

Copy constructor.

Parameters:
rIdentifier[in] : the identifier to initialize this identifier from

Builds up the 64 bits identifier exacly the same as given rIdentifier parameter.


Member Function Documentation

OpenViBE::CIdentifier& operator= ( const OpenViBE::CIdentifier rIdentifier)

Affectation operator.

Parameters:
rIdentifier[in] : the identifier to initialize this identifier from
Returns:
this identifier

Reinitializes the 64 bits identifier exactly the same as given rIdentifier parameter.

OpenViBE::CIdentifier& operator++ ( void  )

Increments this identifier by 1.

Returns:
this identifer
Note:
if this identifier is OV_UndefinedIdentifier, it is not incremented
if this idenfitier is not OV_UndefinedIdentifier, it can not becomre OV_UndefinedIdentifier after being incremented
OpenViBE::CIdentifier& operator-- ( void  )

Decrements this identifier by 1.

Returns:
this identifer
Note:
if this identifier is OV_UndefinedIdentifier, it is not decremented
if this idenfitier is not OV_UndefinedIdentifier, it can not becomre OV_UndefinedIdentifier after being decremented
OpenViBE::CString toString ( void  ) const

Converts this identifier into an OpenViBE string.

Returns:
This identifier represented as an OpenViBE string
OpenViBE::boolean fromString ( const OpenViBE::CString rString)

Reads a an OpenViBE string to extract this identifier.

Parameters:
rString[in] : the string to convert
Returns:
true in case of success.
false in case of error.
OpenViBE::uint64 toUInteger ( void  ) const

Converts this identifier into an unsigned 64 bits integer.

Returns:
The unsigned integer converted identifier
Warning:
Use this function with care, identifiers should not be considered as integers. Actually, the internal 64 bits representation may change, resulting in code port needs if you use this function
static OpenViBE::CIdentifier random ( void  ) [static]

Creates a random identifier.

Returns:
a random identifier
Note:
The returned identifier can not be OV_UndefinedIdentifier

Friends And Related Function Documentation

OV_API OpenViBE::boolean operator== ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Equality test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the two identifiers are equal,
false if the two identifiers are different

Compares both 32 bits parts of the two identifiers and checks if those are equal or not.

See also:
operator!=
OV_API OpenViBE::boolean operator!= ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Difference test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the two identifiers are different,
false if the two identifiers are equal

Compares both 32 bits parts of the two identifiers and checks if those are equal or not.

See also:
operator==
OV_API OpenViBE::boolean operator< ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Order test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the first identifier is less than the second one
false if the first identifier is greater or equal to the second one

Compares both 32 bits parts of the two identifiers.

See also:
operator>
operator==
OV_API OpenViBE::boolean operator> ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Order test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the first identifier is greater than the second one
false if the first identifier is less or equal to the second one

Compares both 32 bits parts of the two identifiers.

See also:
operator<
operator==
OV_API OpenViBE::boolean operator<= ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Order test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the first identifier is less or equal than the second one
false if the first identifier is greater to the second one

Compares both 32 bits parts of the two identifiers.

See also:
operator>
operator==
OV_API OpenViBE::boolean operator>= ( const OpenViBE::CIdentifier rIdentifier1,
const OpenViBE::CIdentifier rIdentifier2 
) [friend]

Order test operator.

Parameters:
rIdentifier1[in] : the first identifier to compare
rIdentifier2[in] : the second identifier to compare
Returns:
true if the first identifier is greater or equal than the second one
false if the first identifier is less to the second one

Compares both 32 bits parts of the two identifiers.

See also:
operator<
operator==