Web Analytics Made Easy - Statcounter
Skip to content

Class SBCGraphNode#

ClassList > 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#

See SBCReferenceTarget

Type Name
SBCReferenceTarget ()
unsigned int getMemoryFootprint () const
void printReferencesToOwners () const
virtual ~SBCReferenceTarget ()

Protected Attributes#

Type Name
SBCGraphArcCollection * predecessors
The list of predecessors.
SBCGraphArcCollection * successors
The list of successors.

Protected Attributes inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTargetData * dataPointer

Protected Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
void removeAllReferenceOwners ()

Detailed Description#

This class is the base class to describe a node in a directed graph with a horizontal structure.

Short name: SBGraphNode

Public Functions Documentation#

function SBCGraphNode#

Builds a graph node with no connections.

SBCGraphNode::SBCGraphNode () 


function addPredecessor#

Adds a predecessor to the graph node.

SBCReferenceListLink * SBCGraphNode::addPredecessor (
    SBCGraphNode * graphNode
) 

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:

  • g A pointer to the graph node that becomes a predecessor of the node.

function addSuccessor#

Adds a successor to the graph node.

SBCReferenceListLink * SBCGraphNode::addSuccessor (
    SBCGraphNode * graphNode
) 

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:

  • g A pointer to the graph node that becomes a successor of the node.

function beginPredecessors#

Returns a begin iterator to predecessors.

iterator SBCGraphNode::beginPredecessors () 


function beginSuccessors#

Returns a begin iterator to successors.

iterator SBCGraphNode::beginSuccessors () 


function endPredecessors#

Returns an end iterator to predecessors.

iterator SBCGraphNode::endPredecessors () 


function endSuccessors#

Returns an end iterator to successors.

iterator SBCGraphNode::endSuccessors () 


function getArcFromPredecessor#

Returns the arc from the predecessor graphNode (0 if not found)

SBCGraphArc * SBCGraphNode::getArcFromPredecessor (
    SBCGraphNode * graphNode
) const


function getArcToSuccessor#

Returns the arc to the successor graphNode (0 if not found)

SBCGraphArc * SBCGraphNode::getArcToSuccessor (
    SBCGraphNode * graphNode
) const


function getNumberOfPredecessors#

Returns the number of predecessors.

unsigned int SBCGraphNode::getNumberOfPredecessors () const


function getNumberOfSuccessors#

Returns the number of successors.

unsigned int SBCGraphNode::getNumberOfSuccessors () const


function printConnections#

Prints the list of connections of the nodes.

void SBCGraphNode::printConnections () const

This functions 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.

reverse_iterator SBCGraphNode::rbeginPredecessors () 


function rbeginSuccessors#

Returns a reverse begin iterator to successors.

reverse_iterator SBCGraphNode::rbeginSuccessors () 


function removeAllPredecessors#

Removes all predecessors to the graph node.

void SBCGraphNode::removeAllPredecessors () 

The time complexity of this operation is proportional to the number of predecessors.


function removeAllSuccessors#

Removes all successors to the graph node.

void SBCGraphNode::removeAllSuccessors () 

The time complexity of this operation is proportional to the number of successors.


function removePredecessor [1/2]#

Removes a predecessor to the graph node.

void SBCGraphNode::removePredecessor (
    SBCGraphNode * graphNode
) 

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)

void SBCGraphNode::removePredecessor (
    SBCReferenceListLink * referenceListLink
) 

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.

void SBCGraphNode::removeSuccessor (
    SBCGraphNode * graphNode
) 

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)

void SBCGraphNode::removeSuccessor (
    SBCReferenceListLink * referenceListLink
) 

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.

reverse_iterator SBCGraphNode::rendPredecessors () 


function rendSuccessors#

Returns a reverse end iterator to successors.

reverse_iterator SBCGraphNode::rendSuccessors () 


function ~SBCGraphNode#

Deletes the graph node. If the node has predecessors or successors, any reference to this node there are automatically removed.

virtual SBCGraphNode::~SBCGraphNode () 


Protected Attributes Documentation#

variable predecessors#

The list of predecessors.

SBCGraphArcCollection* predecessors;


variable successors#

The list of successors.

SBCGraphArcCollection* successors;