Belle II Software prerelease-11-00-00d
Relation< AFrom, ATo > Class Template Reference

Type for two related objects. More...

#include <Relation.h>

Inheritance diagram for Relation< AFrom, ATo >:
Collaboration diagram for Relation< AFrom, ATo >:

Public Types

using From = AFrom
 Type of from which the relation originates.
 
using To = ATo
 Type of to which the relation points.
 

Public Member Functions

bool operator< (const Relation< From, To > &rhs) const
 Operator for ordering of relations.
 
From * getFrom () const
 Getter for the pointer to the from side object.
 
To * getTo () const
 Getter for the pointer to the to side object.
 
Relation< To, From > reversed () const
 Make a relation in the opposite direction with the same weight.
 

Public Attributes

T1 first_type
 STL member.
 
T2 second_type
 STL member.
 

Private Types

using Super = std::pair<AFrom*, ATo*>
 Type of the base class.
 

Friends

bool operator< (const From *ptrFrom, const Relation< From, To > &relation)
 Operator to compare key type item to the relations for associative lookups.
 
bool operator< (const Relation< From, To > &relation, const From *ptrFrom)
 Operator to compare key type item to the relations for associative lookups.
 

Detailed Description

template<class AFrom, class ATo = AFrom>
class Belle2::TrackingUtilities::Relation< AFrom, ATo >

Type for two related objects.

Definition at line 21 of file Relation.h.

Member Typedef Documentation

◆ From

template<class AFrom, class ATo = AFrom>
using From = AFrom

Type of from which the relation originates.

Definition at line 29 of file Relation.h.

◆ Super

template<class AFrom, class ATo = AFrom>
using Super = std::pair<AFrom*, ATo*>
private

Type of the base class.

Definition at line 25 of file Relation.h.

◆ To

template<class AFrom, class ATo = AFrom>
using To = ATo

Type of to which the relation points.

Definition at line 32 of file Relation.h.

Member Function Documentation

◆ getFrom()

template<class AFrom, class ATo = AFrom>
From * getFrom ( ) const
inline

Getter for the pointer to the from side object.

Definition at line 59 of file Relation.h.

60 {
61 return this->first;
62 }

◆ getTo()

template<class AFrom, class ATo = AFrom>
To * getTo ( ) const
inline

Getter for the pointer to the to side object.

Definition at line 65 of file Relation.h.

66 {
67 return this->second;
68 }

◆ operator<()

template<class AFrom, class ATo = AFrom>
bool operator< ( const Relation< From, To > & rhs) const
inline

Operator for ordering of relations.

Definition at line 39 of file Relation.h.

40 {
41 return (getFrom() < rhs.getFrom() or
42 (not(rhs.getFrom() < getFrom()) and
43 (getTo() < rhs.getTo())));
44 }

◆ reversed()

template<class AFrom, class ATo = AFrom>
Relation< To, From > reversed ( ) const
inline

Make a relation in the opposite direction with the same weight.

Definition at line 71 of file Relation.h.

72 {
73 return Relation<To, From>(getTo(), getFrom());
74 }

Friends And Related Symbol Documentation

◆ operator< [1/2]

template<class AFrom, class ATo = AFrom>
bool operator< ( const From * ptrFrom,
const Relation< From, To > & relation )
friend

Operator to compare key type item to the relations for associative lookups.

Definition at line 47 of file Relation.h.

48 {
49 return ptrFrom < relation.getFrom();
50 }

◆ operator< [2/2]

template<class AFrom, class ATo = AFrom>
bool operator< ( const Relation< From, To > & relation,
const From * ptrFrom )
friend

Operator to compare key type item to the relations for associative lookups.

Definition at line 53 of file Relation.h.

54 {
55 return relation.getFrom() < ptrFrom;
56 }

The documentation for this class was generated from the following files: