Ocean
Ocean::SceneDescription::NodeRefManager Class Reference

This class implements a scene description node reference manager. More...

Public Member Functions

 ~NodeRefManager ()
 Destructs the manager. More...
 
NodeRef node (const NodeId nodeId) const
 Returns a node by a given node id. More...
 
NodeRef node (const std::string &name) const
 Returns the first node specified by a given name. More...
 
NodeRef node (const std::string &name, const std::string &filename) const
 Returns the first node specified by a given name defined in a specific file. More...
 
NodeRef node (const std::string &name, const SceneId sceneId) const
 Returns the first node specified by a given name defined in specific scene originally. More...
 
NodeRefs nodes (const std::string &name) const
 Returns all nodes specified by a given name. More...
 
SceneRef scene (const SceneId sceneId) const
 Returns a scene specified by a scene id. More...
 
NodeRef registerNode (Node *node)
 Registers a new node. More...
 
void changeRegisteredNode (NodeId nodeId, const std::string &oldName, const std::string &newName)
 Changes the name of a registered node. More...
 
void unregisterNode (const Node *node)
 Unregisters a node. More...
 

Protected Types

typedef std::unordered_multimap< std::string, NodeIdNameMultiMap
 Definition of a multimap mapping node names to node ids. More...
 
typedef std::unordered_map< NodeId, NodeRefNodeMap
 Definition of a map mapping node ids to node references. More...
 

Protected Attributes

NodeMap nodeMap_
 Map holding all node references. More...
 
NameMultiMap nameMultiMap_
 Map mapping node names to node pointers. More...
 
Lock lock_
 Lock for the node map. More...
 

Detailed Description

This class implements a scene description node reference manager.

Member Typedef Documentation

◆ NameMultiMap

typedef std::unordered_multimap<std::string, NodeId> Ocean::SceneDescription::NodeRefManager::NameMultiMap
protected

Definition of a multimap mapping node names to node ids.

◆ NodeMap

typedef std::unordered_map<NodeId, NodeRef> Ocean::SceneDescription::NodeRefManager::NodeMap
protected

Definition of a map mapping node ids to node references.

Constructor & Destructor Documentation

◆ ~NodeRefManager()

Ocean::SceneDescription::NodeRefManager::~NodeRefManager ( )

Destructs the manager.

Member Function Documentation

◆ changeRegisteredNode()

void Ocean::SceneDescription::NodeRefManager::changeRegisteredNode ( NodeId  nodeId,
const std::string &  oldName,
const std::string &  newName 
)

Changes the name of a registered node.

Parameters
nodeIdId of the node to change
oldNameOld node name
newNameNew node name

◆ node() [1/4]

NodeRef Ocean::SceneDescription::NodeRefManager::node ( const NodeId  nodeId) const

Returns a node by a given node id.

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

Parameters
nodeIdId of the node to return
Returns
Node reference of the requested node

◆ node() [2/4]

NodeRef Ocean::SceneDescription::NodeRefManager::node ( const std::string &  name) const

Returns the first node specified by a given name.

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

Parameters
nameThe name of the node
Returns
Node reference of the requested node

◆ node() [3/4]

NodeRef Ocean::SceneDescription::NodeRefManager::node ( const std::string &  name,
const SceneId  sceneId 
) const

Returns the first node specified by a given name defined in specific scene originally.

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

Parameters
nameThe name of the node
sceneIdId of the scene main owner of the node
Returns
Node reference of the requested node

◆ node() [4/4]

NodeRef Ocean::SceneDescription::NodeRefManager::node ( const std::string &  name,
const std::string &  filename 
) const

Returns the first node specified by a given name defined in a specific file.

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

Parameters
nameThe name of the node
filenameName of the file the node must be defined inside
Returns
Node reference of the requested node

◆ nodes()

NodeRefs Ocean::SceneDescription::NodeRefManager::nodes ( const std::string &  name) const

Returns all nodes specified by a given name.

Parameters
nameThe name of the nodes to return
Returns
Specified nodes

◆ registerNode()

NodeRef Ocean::SceneDescription::NodeRefManager::registerNode ( Node node)

Registers a new node.

Parameters
nodeNode to manage
Returns
Node reference

◆ scene()

SceneRef Ocean::SceneDescription::NodeRefManager::scene ( const SceneId  sceneId) const

Returns a scene specified by a scene id.

Parameters
sceneIdId of the scene to return
Returns
Specified scene

◆ unregisterNode()

void Ocean::SceneDescription::NodeRefManager::unregisterNode ( const Node node)

Unregisters a node.

Field Documentation

◆ lock_

Lock Ocean::SceneDescription::NodeRefManager::lock_
mutableprotected

Lock for the node map.

◆ nameMultiMap_

NameMultiMap Ocean::SceneDescription::NodeRefManager::nameMultiMap_
protected

Map mapping node names to node pointers.

◆ nodeMap_

NodeMap Ocean::SceneDescription::NodeRefManager::nodeMap_
protected

Map holding all node references.


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