A template class to create an IObservableNode object for accessing a Graph node. More...
#include "murl_logic_graph_observable_node.h"
Public Types | |
using | ValueType = NodeType |
Type definition of the value type. | |
Public Member Functions | |
GraphObservableNode () | |
The default constructor. | |
~GraphObservableNode () override | |
The destructor. More... | |
Bool | IsValid () const override |
Check if the graph node is valid. More... | |
Bool | RemoveReference () override |
Remove the reference from the graph node. More... | |
Bool | GetReference (Graph::INode *node) |
Get a reference to a graph node. More... | |
Bool | GetReference (Graph::INamespace *namespaceNode, const String &nodeIdPath) |
Get a reference to a graph node by identifier relative to a namespace. More... | |
Bool | ResolveReference (Graph::INode *node) |
Get a reference to a graph node by resolving a Graph::IReference node. More... | |
Bool | ResolveReference (Graph::INamespace *namespaceNode, const String &nodeIdPath) |
Get a reference to a graph node by resolving a Graph::IReference node by identifier relative to a namespace. More... | |
NodeType * | GetNode () const |
Get the graph node interface. More... | |
Graph::INode * | GetNodeInterface () const |
Get the graph Graph::INode interface. More... | |
NodeType * | DynamicCastNode (Graph::INode *node) const |
Dynamic cast a graph node to this template's node type. More... | |
NodeType * | DynamicCastResolveNode (Graph::INode *node) const |
Dynamic cast a graph node by resolving a Graph::IReference node to this template's node type. More... | |
Protected Member Functions | |
Bool | CreateTypedNode (Graph::INode *node) |
Create a typed graph node pointer and get a reference. More... | |
Graph::INode * | FindNode (Graph::INamespace *namespaceNode, const String &nodeIdPath) const |
Find a graph node by identifier relative to a namespace. More... | |
Graph::INode * | TrackReference (Graph::INode *node) const |
Track a Graph::IReference node's target. More... | |
Detailed Description
template<class NodeType>
class Murl::Logic::GraphObservableNode< NodeType >
A template class to create an IObservableNode object for accessing a Graph node.
Constructor & Destructor Documentation
◆ ~GraphObservableNode()
|
inlineoverride |
The destructor.
Removes the reference from the graph node.
References Murl::Logic::GraphObservableNode< NodeType >::RemoveReference().
Member Function Documentation
◆ IsValid()
|
inlineoverridevirtual |
Check if the graph node is valid.
- Returns
- true if the graph node is valid.
Implements Murl::Logic::IObservableNode.
◆ RemoveReference()
|
inlineoverridevirtual |
Remove the reference from the graph node.
- Returns
- true if successful or if the graph node is null.
Implements Murl::Logic::IObservableNode.
References Murl::Logic::GraphObservableNode< NodeType >::GetNodeInterface(), and Murl::Graph::INode::RemoveReference().
Referenced by Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode(), and Murl::Logic::GraphObservableNode< NodeType >::~GraphObservableNode().
◆ GetReference() [1/2]
|
inline |
Get a reference to a graph node.
- Parameters
-
node The graph node.
- Returns
- true if successful.
References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode().
◆ GetReference() [2/2]
|
inline |
Get a reference to a graph node by identifier relative to a namespace.
- Parameters
-
namespaceNode The graph namespace node. nodeIdPath The node ID to find, with optional path specification when searching in sub-namespaces.
- Returns
- true if successful.
References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode(), and Murl::Logic::GraphObservableNode< NodeType >::FindNode().
◆ ResolveReference() [1/2]
|
inline |
Get a reference to a graph node by resolving a Graph::IReference node.
- Parameters
-
node The Graph::IReference node to resolve.
- Returns
- true if successful.
References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode(), and Murl::Logic::GraphObservableNode< NodeType >::TrackReference().
◆ ResolveReference() [2/2]
|
inline |
Get a reference to a graph node by resolving a Graph::IReference node by identifier relative to a namespace.
- Parameters
-
namespaceNode The graph namespace node. nodeIdPath The node ID to find, with optional path specification when searching in sub-namespaces.
- Returns
- true if successful.
References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode(), Murl::Logic::GraphObservableNode< NodeType >::FindNode(), and Murl::Logic::GraphObservableNode< NodeType >::TrackReference().
◆ GetNode()
|
inline |
Get the graph node interface.
- Returns
- A pointer to the graph node interface or null.
◆ GetNodeInterface()
|
inline |
Get the graph Graph::INode interface.
- Returns
- A pointer to the Graph::INode interface or null.
Referenced by Murl::Logic::GraphObservableNode< NodeType >::RemoveReference().
◆ DynamicCastNode()
|
inline |
Dynamic cast a graph node to this template's node type.
- Parameters
-
node The graph node to cast.
- Returns
- A pointer to the graph node interface or null.
Referenced by Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode().
◆ DynamicCastResolveNode()
|
inline |
Dynamic cast a graph node by resolving a Graph::IReference node to this template's node type.
- Parameters
-
node The graph node to cast.
- Returns
- A pointer to the graph node interface or null.
References Murl::Logic::GraphObservableNode< NodeType >::TrackReference().
◆ CreateTypedNode()
|
inlineprotected |
Create a typed graph node pointer and get a reference.
Dynamic cast the graph node pointer to the template's graph node type and add a reference to the node if successful.
- Parameters
-
node The graph node.
- Returns
- true if successful.
References Murl::Graph::INode::AddReference(), Murl::String::Begin(), Murl::Logic::GraphObservableNode< NodeType >::DynamicCastNode(), Murl::Graph::INode::GetId(), MURL_ERROR, and Murl::Logic::GraphObservableNode< NodeType >::RemoveReference().
Referenced by Murl::Logic::GraphObservableNode< NodeType >::GetReference(), and Murl::Logic::GraphObservableNode< NodeType >::ResolveReference().
◆ FindNode()
|
inlineprotected |
Find a graph node by identifier relative to a namespace.
- Parameters
-
namespaceNode The graph namespace node. nodeIdPath The node ID to find, with optional path specification when searching in sub-namespaces.
- Returns
- A pointer to the graph node or null if not found.
References Murl::String::Begin(), Murl::Graph::INamespace::FindNode(), Murl::Graph::INode::GetId(), Murl::Graph::INamespace::GetNodeInterface(), Murl::String::IsEmpty(), and MURL_ERROR.
Referenced by Murl::Logic::GraphObservableNode< NodeType >::GetReference(), and Murl::Logic::GraphObservableNode< NodeType >::ResolveReference().
◆ TrackReference()
|
inlineprotected |
Track a Graph::IReference node's target.
- Parameters
-
node The graph node to track.
- Returns
- A pointer to the target node.
References Murl::String::Begin(), Murl::Graph::INode::GetId(), Murl::Graph::IReference::GetNodeInterface(), Murl::Graph::IReference::GetNodeTarget(), and MURL_ERROR.
Referenced by Murl::Logic::GraphObservableNode< NodeType >::DynamicCastResolveNode(), and Murl::Logic::GraphObservableNode< NodeType >::ResolveReference().
The documentation for this class was generated from the following file:
- murl_logic_graph_observable_node.h