17 namespace TrackFindingCDC {
20 template <
class AFrom,
class ATo = AFrom>
21 class Relation :
public std::pair<AFrom*, ATo*> {
25 using Super = std::pair<AFrom*, ATo*>;
49 return ptrFrom < relation.
getFrom();
55 return relation.
getFrom() < ptrFrom;
Type for two related objects.
bool operator<(const Relation< From, To > &rhs) const
Operator for ordering of relations.
std::pair< AFrom *, ATo * > Super
Type of the base class.
From * getFrom() const
Getter for the pointer to the from side object.
AFrom From
Type of from which the relation originates.
friend bool operator<(const From *ptrFrom, const Relation< From, To > &relation)
Operator to compare key type item to the relations for associative lookups.
ATo To
Type of to which the relation points.
To * getTo() const
Getter for the pointer to the to side object.
friend bool operator<(const Relation< From, To > &relation, const From *ptrFrom)
Operator to compare key type item to the relations for associative lookups.
Relation< To, From > reversed() const
Make a relation in the opposite direction with the same weight.
Abstract base class for different kinds of events.