Ocean
|
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, NodeId > | NameMultiMap |
Definition of a multimap mapping node names to node ids. More... | |
typedef std::unordered_map< NodeId, NodeRef > | NodeMap |
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... | |
This class implements a scene description node reference manager.
|
protected |
Definition of a multimap mapping node names to node ids.
|
protected |
Definition of a map mapping node ids to node references.
Ocean::SceneDescription::NodeRefManager::~NodeRefManager | ( | ) |
Destructs the manager.
void Ocean::SceneDescription::NodeRefManager::changeRegisteredNode | ( | NodeId | nodeId, |
const std::string & | oldName, | ||
const std::string & | newName | ||
) |
Changes the name of a registered node.
nodeId | Id of the node to change |
oldName | Old node name |
newName | New node name |
Returns a node by a given node id.
If the node does not exist an empty reference is returned.
nodeId | Id of the node to return |
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.
name | The name of the node |
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.
name | The name of the node |
sceneId | Id of the scene main owner of the node |
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.
name | The name of the node |
filename | Name of the file the node must be defined inside |
NodeRefs Ocean::SceneDescription::NodeRefManager::nodes | ( | const std::string & | name | ) | const |
Returns all nodes specified by a given name.
name | The name of the nodes to return |
Returns a scene specified by a scene id.
sceneId | Id of the scene to return |
void Ocean::SceneDescription::NodeRefManager::unregisterNode | ( | const Node * | node | ) |
Unregisters a node.
|
protected |
Map mapping node names to node pointers.
|
protected |
Map holding all node references.