Ocean
Ocean::Devices::Measurement::ObjectMapper< TInternalId > Class Template Reference

This class implements a helper class to simplify the mapping between internal object ids (of the actual tracking implementation) and extern object ids (of the device system). More...

Public Member Functions

 ObjectMapper (Measurement &owner)
 Default constructor. More...
 
bool hasInternalObject (const TInternalId &internalObjectId) const
 Returns whether this mapping object holds a specific internal object. More...
 
bool hasExternalObject (const Measurement::ObjectId &externalObjectId) const
 Returns whether this mapping object holds a specific external object. More...
 
ObjectId newInternalObjectId (const TInternalId &internalObjectId, const std::string &description)
 Adds a new internal pattern id. More...
 
void removeInternalObject (const TInternalId &internalObjectId)
 Removes a mapping between internal and external object. More...
 
ObjectId externalObjectIdFromInternalObjectId (const TInternalId &internalObjectId) const
 Converts the tracker's internal object id to an external object id. More...
 
TInternalId internalObjectIdFromExternalObjectId (const ObjectId externalObjectId, const TInternalId &invalidInternalId) const
 Converts an external object id to the tracker tracker's internal object id. More...
 

Protected Types

typedef std::unordered_map< TInternalId, ObjectIdInternalObjectIdMap
 Definition of an unordered map mapping internal object ids to external object ids. More...
 
typedef std::unordered_map< ObjectId, TInternalId > ExternalObjectIdMap
 Definition of an unordered map mapping external object ids to internal object ids. More...
 

Protected Member Functions

 ObjectMapper (const ObjectMapper &objectMapper)=delete
 Disabled copy constructor. More...
 
ObjectMapperoperator= (const ObjectMapper &objectMapper)=delete
 Disabled copy operator. More...
 

Protected Attributes

Measurementowner_
 The owner of this mapper. More...
 
InternalObjectIdMap internalObjectIdMap_
 The map mapping internal object ids to external object ids. More...
 
ExternalObjectIdMap externalObjectIdMap_
 The map mapping external object ids to internal object ids. More...
 

Detailed Description

template<typename TInternalId>
class Ocean::Devices::Measurement::ObjectMapper< TInternalId >

This class implements a helper class to simplify the mapping between internal object ids (of the actual tracking implementation) and extern object ids (of the device system).

Template Parameters
TInternalIdThe data type of the internal object id.

Member Typedef Documentation

◆ ExternalObjectIdMap

template<typename TInternalId >
typedef std::unordered_map<ObjectId, TInternalId> Ocean::Devices::Measurement::ObjectMapper< TInternalId >::ExternalObjectIdMap
protected

Definition of an unordered map mapping external object ids to internal object ids.

◆ InternalObjectIdMap

template<typename TInternalId >
typedef std::unordered_map<TInternalId, ObjectId> Ocean::Devices::Measurement::ObjectMapper< TInternalId >::InternalObjectIdMap
protected

Definition of an unordered map mapping internal object ids to external object ids.

Constructor & Destructor Documentation

◆ ObjectMapper() [1/2]

template<typename TInternalId >
Ocean::Devices::Measurement::ObjectMapper< TInternalId >::ObjectMapper ( Measurement owner)
inlineexplicit

Default constructor.

◆ ObjectMapper() [2/2]

template<typename TInternalId >
Ocean::Devices::Measurement::ObjectMapper< TInternalId >::ObjectMapper ( const ObjectMapper< TInternalId > &  objectMapper)
protecteddelete

Disabled copy constructor.

Parameters
objectMapperObject which would be copied

Member Function Documentation

◆ externalObjectIdFromInternalObjectId()

template<typename TInternalId >
Measurement::ObjectId Ocean::Devices::Measurement::ObjectMapper< TInternalId >::externalObjectIdFromInternalObjectId ( const TInternalId &  internalObjectId) const

Converts the tracker's internal object id to an external object id.

Parameters
internalObjectIdThe internal object id to translate
Returns
The resulting external object id

◆ hasExternalObject()

template<typename TInternalId >
bool Ocean::Devices::Measurement::ObjectMapper< TInternalId >::hasExternalObject ( const Measurement::ObjectId externalObjectId) const

Returns whether this mapping object holds a specific external object.

Parameters
externalObjectIdThe id of the external object to be checked, must be valid
Returns
True, if so

◆ hasInternalObject()

template<typename TInternalId >
bool Ocean::Devices::Measurement::ObjectMapper< TInternalId >::hasInternalObject ( const TInternalId &  internalObjectId) const

Returns whether this mapping object holds a specific internal object.

Parameters
internalObjectIdThe id of the internal object to be checked
Returns
True, if so

◆ internalObjectIdFromExternalObjectId()

template<typename TInternalId >
TInternalId Ocean::Devices::Measurement::ObjectMapper< TInternalId >::internalObjectIdFromExternalObjectId ( const ObjectId  externalObjectId,
const TInternalId &  invalidInternalId 
) const

Converts an external object id to the tracker tracker's internal object id.

Parameters
externalObjectIdThe external object id to translate
invalidInternalIdAn invalid internal id
Returns
The resulting internal object id

◆ newInternalObjectId()

template<typename TInternalId >
Measurement::ObjectId Ocean::Devices::Measurement::ObjectMapper< TInternalId >::newInternalObjectId ( const TInternalId &  internalObjectId,
const std::string &  description 
)

Adds a new internal pattern id.

Parameters
internalObjectIdThe new internal object id to add
descriptionThe description of the new pattern
Returns
The corresponding external object id

◆ operator=()

template<typename TInternalId >
ObjectMapper& Ocean::Devices::Measurement::ObjectMapper< TInternalId >::operator= ( const ObjectMapper< TInternalId > &  objectMapper)
protecteddelete

Disabled copy operator.

Parameters
objectMapperObject which would be copied
Returns
Reference to this object

◆ removeInternalObject()

template<typename TInternalId >
void Ocean::Devices::Measurement::ObjectMapper< TInternalId >::removeInternalObject ( const TInternalId &  internalObjectId)

Removes a mapping between internal and external object.

Parameters
internalObjectIdThe id of the internal object for which the mapping will be removed

Field Documentation

◆ externalObjectIdMap_

template<typename TInternalId >
ExternalObjectIdMap Ocean::Devices::Measurement::ObjectMapper< TInternalId >::externalObjectIdMap_
protected

The map mapping external object ids to internal object ids.

◆ internalObjectIdMap_

template<typename TInternalId >
InternalObjectIdMap Ocean::Devices::Measurement::ObjectMapper< TInternalId >::internalObjectIdMap_
protected

The map mapping internal object ids to external object ids.

◆ owner_

template<typename TInternalId >
Measurement& Ocean::Devices::Measurement::ObjectMapper< TInternalId >::owner_
protected

The owner of this mapper.


The documentation for this class was generated from the following file: