Class SBCGraphNode#
This class is the base class to describe a node in a directed graph with a horizontal structure. More...
#include "SBCGraphNode.hpp"
Inherits the following classes: SBCReferenceTarget
Inherited by the following classes: SBCGraphNodeTemplate
Classes#
| Type | Name |
|---|---|
| class | iterator |
| class | reverse_iterator |
Public Functions#
| Type | Name |
|---|---|
| SBCGraphNode () Builds a graph node with no connections. |
|
| SBCReferenceListLink * | addPredecessor (SBCGraphNode * graphNode) Adds a predecessor to the graph node. |
| SBCReferenceListLink * | addSuccessor (SBCGraphNode * graphNode) Adds a successor to the graph node. |
| iterator | beginPredecessors () Returns a begin iterator to predecessors. |
| iterator | beginSuccessors () Returns a begin iterator to successors. |
| iterator | endPredecessors () Returns an end iterator to predecessors. |
| iterator | endSuccessors () Returns an end iterator to successors. |
| SBCGraphArc * | getArcFromPredecessor (SBCGraphNode * graphNode) const Returns the arc from the predecessor graphNode (0 if not found) |
| SBCGraphArc * | getArcToSuccessor (SBCGraphNode * graphNode) const Returns the arc to the successor graphNode (0 if not found) |
| unsigned int | getNumberOfPredecessors () const Returns the number of predecessors. |
| unsigned int | getNumberOfSuccessors () const Returns the number of successors. |
| void | printConnections () const Prints the list of connections of the nodes. |
| reverse_iterator | rbeginPredecessors () Returns a reverse begin iterator to predecessors. |
| reverse_iterator | rbeginSuccessors () Returns a reverse begin iterator to successors. |
| void | removeAllPredecessors () Removes all predecessors to the graph node. |
| void | removeAllSuccessors () Removes all successors to the graph node. |
| void | removePredecessor (SBCGraphNode * graphNode) Removes a predecessor to the graph node. |
| void | removePredecessor (SBCReferenceListLink * referenceListLink) Removes a predecessor to the graph node (constant time) |
| void | removeSuccessor (SBCGraphNode * graphNode) Removes a successor to the graph node. |
| void | removeSuccessor (SBCReferenceListLink * referenceListLink) Removes a successor to the graph node (constant time) |
| reverse_iterator | rendPredecessors () Returns a reverse end iterator to predecessors. |
| reverse_iterator | rendSuccessors () Returns a reverse end iterator to successors. |
| virtual | ~SBCGraphNode () Deletes the graph node. If the node has predecessors or successors, any reference to this node there are automatically removed. |
Public Functions inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTarget () Builds the reference target. |
|
| unsigned int | getMemoryFootprint () const Returns the memory footprint. |
| void | printReferencesToOwners () const Prints the references to the owners of this reference target. |
| virtual | ~SBCReferenceTarget () Destructor. |
Protected Attributes#
| Type | Name |
|---|---|
| SBCGraphArcCollection * | predecessors The list of predecessors. |
| SBCGraphArcCollection * | successors The list of successors. |
Protected Attributes inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTarget (SBCReferenceTargetData * dataPointer) Protected constructor. |
|
| void | removeAllReferenceOwners () Stops all the reference owners from referencing this reference target. |
Detailed Description#
Short name: SBGraphNode
Public Functions Documentation#
function SBCGraphNode#
Builds a graph node with no connections.
function addPredecessor#
Adds a predecessor to the graph node.
The node pointed by g becomes a predecessor of the current node, while the current node becomes a successor of the node pointed by g.
The function returns a pointer to the link holding a reference to the connection, which may be used for constant-time removal of the reference to the successor (see SBCClass for more information on references).
Parameters:
gA pointer to the graph node that becomes a predecessor of the node.
function addSuccessor#
Adds a successor to the graph node.
The node pointed by g becomes a successor of the current node, while the current node becomes a predecessor of the node pointed by g.
The function returns a pointer to the link holding a reference to the connection, which may be used for constant-time removal of the reference to the successor (see SBCClass for more information on references).
Parameters:
gA pointer to the graph node that becomes a successor of the node.
function beginPredecessors#
Returns a begin iterator to predecessors.
function beginSuccessors#
Returns a begin iterator to successors.
function endPredecessors#
Returns an end iterator to predecessors.
function endSuccessors#
Returns an end iterator to successors.
function getArcFromPredecessor#
Returns the arc from the predecessor graphNode (0 if not found)
function getArcToSuccessor#
Returns the arc to the successor graphNode (0 if not found)
function getNumberOfPredecessors#
Returns the number of predecessors.
function getNumberOfSuccessors#
Returns the number of successors.
function printConnections#
Prints the list of connections of the nodes.
This function prints the list of connections to and from this node. This should be used for debugging purposes only.
function rbeginPredecessors#
Returns a reverse begin iterator to predecessors.
function rbeginSuccessors#
Returns a reverse begin iterator to successors.
function removeAllPredecessors#
Removes all predecessors to the graph node.
The time complexity of this operation is proportional to the number of predecessors.
function removeAllSuccessors#
Removes all successors to the graph node.
The time complexity of this operation is proportional to the number of successors.
function removePredecessor [1/2]#
Removes a predecessor to the graph node.
The time complexity of this operation is proportional to the number of predecessors.
function removePredecessor [2/2]#
Removes a predecessor to the graph node (constant time)
The time complexity of this operation is constant since referenceLink is a direct pointer to the link holding the reference to the predecessor in the list of references to predecessors.
This reference was returned by SBCGraphNode::addPredecessor.
function removeSuccessor [1/2]#
Removes a successor to the graph node.
The time complexity of this operation is proportional to the number of successors.
function removeSuccessor [2/2]#
Removes a successor to the graph node (constant time)
The time complexity of this operation is constant since referenceLink is a direct pointer to the link holding the reference to the successor in the list of references to successors.
This reference was returned by SBCGraphNode::addSuccessor.
function rendPredecessors#
Returns a reverse end iterator to predecessors.
function rendSuccessors#
Returns a reverse end iterator to successors.
function ~SBCGraphNode#
Deletes the graph node. If the node has predecessors or successors, any reference to this node there are automatically removed.
Protected Attributes Documentation#
variable predecessors#
The list of predecessors.
variable successors#
The list of successors.