C4 Engine
C4 Engine API Documentation

class GraphRelation

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

template <class elementType, class relationType> class GraphRelation : public GraphRelationFinish

Member Functions
GraphRelation::GetStartElement Returns the graph element at which a relation starts.
GraphRelation::SetStartElement Sets the graph element at which a relation starts.
GraphRelation::GetFinishElement Returns the graph element at which a relation finishes.
GraphRelation::SetFinishElement Sets the graph element at which a relation finishes.
GraphRelation::GetPreviousOutgoingRelation Returns the previous outgoing relation for a graph element.
GraphRelation::GetNextOutgoingRelation Returns the next outgoing relation for a graph element.
GraphRelation::GetPreviousIncomingRelation Returns the previous incoming relation for a graph element.
GraphRelation::GetNextIncomingRelation Returns the next incoming relation for a graph element.
Template Parameters
elementType The type of the class that can be stored as an element in the graph.
relationType The type of the class that represents the relations in the graph. This parameter should be the type of the class that inherits directly from the GraphRelation class.
Constructor

GraphRelation(GraphElement<elementType, relationType> *start, GraphElement<elementType, relationType> *finish);

Parameters
start A pointer to the element at the start of the relation.
finish A pointer to the element at the finish of the relation.
Description
The GraphRelation class should be declared as a base class for objects that represent relations in a directed graph. The relationType template parameter should match the class type of such objects. The elementType template parameter should match the type of the class representing the elements in the graph.

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

GraphElement

Graph