Ocean
Ocean::Rendering::ObjectRefManager Class Reference

This class implements a rendering object reference manager. More...

Inheritance diagram for Ocean::Rendering::ObjectRefManager:

Public Member Functions

bool hasEngineObject (const std::string &engine, const bool writeObjectToLog) const
 Tests whether this manager holds still some objects of a specific rendering engine. More...
 

Protected Types

typedef std::unordered_multimap< std::string, ObjectIdNameMap
 Definition of a multimap mapping object names to object ids. More...
 
typedef std::unordered_map< ObjectId, ObjectRefObjectMap
 Definition of a map mapping object ids to object references. More...
 

Protected Member Functions

 ~ObjectRefManager ()
 Destructs the manager. More...
 
ObjectRef object (const ObjectId objectId) const
 Returns an object by a given object id. More...
 
ObjectRef object (const std::string &name) const
 Returns the first object specified by a given name. More...
 
ObjectRefs objects (const std::string &name) const
 Returns all objects specified by a given name. More...
 
ObjectRef registerObject (Object *object)
 Registers a new object. More...
 
void changeRegisteredObject (ObjectId objectId, const std::string &oldName, const std::string &newName)
 Changes the name of a registered object. More...
 
void unregisterObject (const Object *object)
 Unregisters an object. More...
 
- Protected Member Functions inherited from Ocean::Singleton< ObjectRefManager >
 Singleton ()=default
 Default constructor. More...
 

Protected Attributes

ObjectMap objectMap_
 Map holding all object references. More...
 
NameMap nameMap_
 Map mapping object names to object pointers. More...
 
Lock lock_
 Lock for the object map. More...
 

Friends

class Singleton< ObjectRefManager >
 
class Ocean::ObjectRef< Object >
 
class Engine
 
class Factory
 
class Object
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< ObjectRefManager >
static ObjectRefManager & get ()
 Returns a reference to the unique object. More...
 

Detailed Description

This class implements a rendering object reference manager.

Member Typedef Documentation

◆ NameMap

typedef std::unordered_multimap<std::string, ObjectId> Ocean::Rendering::ObjectRefManager::NameMap
protected

Definition of a multimap mapping object names to object ids.

◆ ObjectMap

typedef std::unordered_map<ObjectId, ObjectRef> Ocean::Rendering::ObjectRefManager::ObjectMap
protected

Definition of a map mapping object ids to object references.

Constructor & Destructor Documentation

◆ ~ObjectRefManager()

Ocean::Rendering::ObjectRefManager::~ObjectRefManager ( )
protected

Destructs the manager.

Member Function Documentation

◆ changeRegisteredObject()

void Ocean::Rendering::ObjectRefManager::changeRegisteredObject ( ObjectId  objectId,
const std::string &  oldName,
const std::string &  newName 
)
protected

Changes the name of a registered object.

Parameters
objectIdId of the object to change
oldNameOld object name
newNameNew object name

◆ hasEngineObject()

bool Ocean::Rendering::ObjectRefManager::hasEngineObject ( const std::string &  engine,
const bool  writeObjectToLog 
) const

Tests whether this manager holds still some objects of a specific rendering engine.

Parameters
engineName of the engine to test
writeObjectToLogTrue, to write all engine objects to the log
Returns
True, if so

◆ object() [1/2]

ObjectRef Ocean::Rendering::ObjectRefManager::object ( const ObjectId  objectId) const
protected

Returns an object by a given object id.

If the object does not exist an empty reference is returned.

Parameters
objectIdId of the object to return
Returns
Object reference of the requested object
See also
Engine::object().

◆ object() [2/2]

ObjectRef Ocean::Rendering::ObjectRefManager::object ( const std::string &  name) const
protected

Returns the first object specified by a given name.

If the object does not exist an empty reference is returned.

Parameters
nameThe name of the object
Returns
Object reference of the requested object
See also
Engine::object().

◆ objects()

ObjectRefs Ocean::Rendering::ObjectRefManager::objects ( const std::string &  name) const
protected

Returns all objects specified by a given name.

Parameters
nameThe name of the objects to return
Returns
Specified objects
See also
Engine::objects().

◆ registerObject()

ObjectRef Ocean::Rendering::ObjectRefManager::registerObject ( Object object)
protected

Registers a new object.

Parameters
objectThe object to manage, must be valid
Returns
Object reference

◆ unregisterObject()

void Ocean::Rendering::ObjectRefManager::unregisterObject ( const Object object)
protected

Unregisters an object.

Friends And Related Function Documentation

◆ Engine

friend class Engine
friend

◆ Factory

friend class Factory
friend

◆ Object

friend class Object
friend

◆ Ocean::ObjectRef< Object >

friend class Ocean::ObjectRef< Object >
friend

◆ Singleton< ObjectRefManager >

friend class Singleton< ObjectRefManager >
friend

Field Documentation

◆ lock_

Lock Ocean::Rendering::ObjectRefManager::lock_
mutableprotected

Lock for the object map.

◆ nameMap_

NameMap Ocean::Rendering::ObjectRefManager::nameMap_
protected

Map mapping object names to object pointers.

◆ objectMap_

ObjectMap Ocean::Rendering::ObjectRefManager::objectMap_
protected

Map holding all object references.


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