C4 Engine
C4 Engine API Documentation

class GraphElement

Defined in:  TSGraph.h
The GraphElement class is the base class for elements in a directed graph.
Definition

template <class elementType, class relationType> class GraphElement : public GraphElementBase

Member Functions
GraphElement::GetFirstOutgoingRelation Returns the first outgoing relation for a graph element.
GraphElement::GetLastOutgoingRelation Returns the last outgoing relation for a graph element.
GraphElement::GetFirstIncomingRelation Returns the first incoming relation for a graph element.
GraphElement::GetLastIncomingRelation Returns the last incoming relation for a graph element.
GraphElement::FindOutgoingRelation Returns the outgoing relation with a specific finish element.
GraphElement::FindIncomingRelation Returns the incoming relation with a specific start element.
Template Parameters
elementType The type of the class that can be stored as an element in the graph. This parameter should be the type of the class that inherits directly from the GraphElement class.
relationType The type of the class that represents the relations in the graph.
Constructor

GraphElement();

GraphElement(Graph<elementType, relationType> *graph);

Parameters
graph The graph to which the element should be added.
Description
The GraphElement class should be declared as a base class for objects that represent elements in a directed graph. The elementType template parameter should match the class type of such objects. The relationType template parameter should match the type of the class representing the relations in the graph.

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

GraphRelation

Graph