Utility Library
C4Graph.h

class GraphNode

The GraphNode class is the base class for nodes in a directed graph.
Definition

template <class nodeType, class edgeType> class GraphNode : public GraphNodeBase

Template Parameters
nodeType The type of the class that can be stored as a node in the graph. This parameter should be the type of the class which inherits directly from the GraphNode class.
edgeType The type of the class that represents the edges in the graph.
Constructor

GraphNode();

GraphNode(Graph<nodeType, edgeType> *graph);

Parameters
graph The graph to which the node should be added. The constructor has protected access. The GraphNode class can only exist as a base class for another class.
Description
The GraphNode class should be declared as a base class for objects that represent nodes in a directed graph. The nodeType template parameter should match the class type of such objects. The edgeType template parameter should match the type of the class representing the edges in the graph.

If the graph parameter is specified, then the node is added to the graph object that it points to.
Base Classes
GraphNodeBase Used internally to encapsulate common functionality that is independent of the template parameter.
See Also
GraphEdge

Graph