Murl::Logic::GraphObservableNode< NodeType > Class Template Reference

A template class to create an IObservableNode object for accessing a Graph node. More...

#include "murl_logic_graph_observable_node.h"

Inheritance diagram for Murl::Logic::GraphObservableNode< NodeType >:

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::INodeGetNodeInterface () 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::INodeFindNode (Graph::INamespace *namespaceNode, const String &nodeIdPath) const
 Find a graph node by identifier relative to a namespace. More...
 
Graph::INodeTrackReference (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()

template<class NodeType >
Murl::Logic::GraphObservableNode< NodeType >::~GraphObservableNode ( )
inlineoverride

The destructor.

Removes the reference from the graph node.

References Murl::Logic::GraphObservableNode< NodeType >::RemoveReference().

Member Function Documentation

◆ IsValid()

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::IsValid ( ) const
inlineoverridevirtual

Check if the graph node is valid.

Returns
true if the graph node is valid.

Implements Murl::Logic::IObservableNode.

◆ RemoveReference()

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::RemoveReference ( )
inlineoverridevirtual

◆ GetReference() [1/2]

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::GetReference ( Graph::INode node)
inline

Get a reference to a graph node.

Parameters
nodeThe graph node.
Returns
true if successful.

References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode().

◆ GetReference() [2/2]

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::GetReference ( Graph::INamespace namespaceNode,
const String nodeIdPath 
)
inline

Get a reference to a graph node by identifier relative to a namespace.

Parameters
namespaceNodeThe graph namespace node.
nodeIdPathThe 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]

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::ResolveReference ( Graph::INode node)
inline

Get a reference to a graph node by resolving a Graph::IReference node.

Parameters
nodeThe Graph::IReference node to resolve.
Returns
true if successful.

References Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode(), and Murl::Logic::GraphObservableNode< NodeType >::TrackReference().

◆ ResolveReference() [2/2]

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::ResolveReference ( Graph::INamespace namespaceNode,
const String nodeIdPath 
)
inline

Get a reference to a graph node by resolving a Graph::IReference node by identifier relative to a namespace.

Parameters
namespaceNodeThe graph namespace node.
nodeIdPathThe 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()

template<class NodeType >
NodeType* Murl::Logic::GraphObservableNode< NodeType >::GetNode ( ) const
inline

Get the graph node interface.

Returns
A pointer to the graph node interface or null.

◆ GetNodeInterface()

template<class NodeType >
Graph::INode* Murl::Logic::GraphObservableNode< NodeType >::GetNodeInterface ( ) const
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()

template<class NodeType >
NodeType* Murl::Logic::GraphObservableNode< NodeType >::DynamicCastNode ( Graph::INode node) const
inline

Dynamic cast a graph node to this template's node type.

Parameters
nodeThe graph node to cast.
Returns
A pointer to the graph node interface or null.

Referenced by Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode().

◆ DynamicCastResolveNode()

template<class NodeType >
NodeType* Murl::Logic::GraphObservableNode< NodeType >::DynamicCastResolveNode ( Graph::INode node) const
inline

Dynamic cast a graph node by resolving a Graph::IReference node to this template's node type.

Parameters
nodeThe graph node to cast.
Returns
A pointer to the graph node interface or null.

References Murl::Logic::GraphObservableNode< NodeType >::TrackReference().

◆ CreateTypedNode()

template<class NodeType >
Bool Murl::Logic::GraphObservableNode< NodeType >::CreateTypedNode ( Graph::INode node)
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
nodeThe 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()

template<class NodeType >
Graph::INode* Murl::Logic::GraphObservableNode< NodeType >::FindNode ( Graph::INamespace namespaceNode,
const String nodeIdPath 
) const
inlineprotected

Find a graph node by identifier relative to a namespace.

Parameters
namespaceNodeThe graph namespace node.
nodeIdPathThe 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()

template<class NodeType >
Graph::INode* Murl::Logic::GraphObservableNode< NodeType >::TrackReference ( Graph::INode node) const
inlineprotected

The documentation for this class was generated from the following file:
  • murl_logic_graph_observable_node.h


Copyright © 2011-2022 Spraylight GmbH.