C4 Engine Terathon Software C4 Engine API Documentation

• Utility Library

API Links
Developer Links

class GraphEdge

Defined in:  C4Graph.h
The GraphEdge class is the base class for edges connecting nodes in a directed graph.
Definition

template <class nodeType, class edgeType> class GraphEdge : public GraphEdgeFinish

Member Functions
GraphEdge::GetStartNode Returns the node at which an edge starts.
GraphEdge::SetStartNode Sets the node at which an edge starts.
GraphEdge::GetFinishNode Returns the node at which an edge finishes.
GraphEdge::SetFinishNode Sets the node at which an edge finishes.
GraphEdge::GetPreviousOutgoingEdge Returns the previous outgoing edge for a node.
GraphEdge::GetNextOutgoingEdge Returns the next outgoing edge for a node.
GraphEdge::GetPreviousIncomingEdge Returns the previous incoming edge for a node.
GraphEdge::GetNextIncomingEdge Returns the next incoming edge for a node.
Template Parameters
nodeType The type of the class that can be stored as a node in the graph.
edgeType The type of the class that represents the edges in the graph. This parameter should be the type of the class that inherits directly from the GraphEdge class.
Constructor

GraphEdge(GraphNode<nodeType, edgeType> *start, GraphNode<nodeType, edgeType> *finish);

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

The start and finish parameters specify the graph nodes at the start and finish of the directed edge. These may not be nullptr. When a GraphEdge instance is constructed, the edge automatically becomes an outgoing edge for the node specified by the start parameter and an incoming edge for the node specified by the finish parameter.
Base Classes
GraphEdgeFinish Used internally to encapsulate common functionality that is independent of the template parameter.
See Also

GraphNode

Graph