Belle II Software development
Relation< AFrom, ATo > Class Template Reference

Type for two related objects. More...

#include <Relation.h>

Inheritance 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.
 
FromgetFrom () const
 Getter for the pointer to the from side object.
 
TogetTo () const
 Getter for the pointer to the to side object.
 
Relation< To, Fromreversed () const
 Make a relation in the opposite direciton with the same weight.
 

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 assoziative lookups.
 
bool operator< (const Relation< From, To > &relation, const From *ptrFrom)
 Operator to compare key type item to the relations for assoziative lookups.
 

Detailed Description

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

Type for two related objects.

Definition at line 21 of file Relation.h.

Member Typedef Documentation

◆ From

using From = AFrom

Type of from which the relation originates.

Definition at line 29 of file Relation.h.

◆ Super

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

Type of the base class.

Definition at line 25 of file Relation.h.

◆ To

using To = ATo

Type of to which the relation points.

Definition at line 32 of file Relation.h.

Member Function Documentation

◆ getFrom()

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()

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<()

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 }
From * getFrom() const
Getter for the pointer to the from side object.
Definition: Relation.h:59
To * getTo() const
Getter for the pointer to the to side object.
Definition: Relation.h:65

◆ reversed()

Relation< To, From > reversed ( ) const
inline

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

Definition at line 71 of file Relation.h.

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

Friends And Related Function Documentation

◆ operator< [1/2]

bool operator< ( const From ptrFrom,
const Relation< From, To > &  relation 
)
friend

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

Definition at line 47 of file Relation.h.

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

◆ operator< [2/2]

bool operator< ( const Relation< From, To > &  relation,
const From ptrFrom 
)
friend

Operator to compare key type item to the relations for assoziative 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: