A mixin class to attach a weight to an object.
More...
#include <WithWeight.h>
|
| WithWeight (const T &t) |
| Also forward the copy constructor form the base class object.
|
|
| WithWeight (const T &t, Weight weight) |
| Constructor which may also initialise the weight to a desired value.
|
|
bool | operator< (const WithWeight< T > &other) const |
| Comparison operator establishing an ordering considering the pointer first and the weight second.
|
|
Weight | getWeight () const |
| Getter for the weight.
|
|
void | setWeight (Weight weight) |
| Setter for the weight of the object.
|
|
Weight & | weight () |
| Mutable getter for the weight.
|
|
|
using | Super = ScalarToClass<T> |
| Type of the base class.
|
|
|
Weight | m_weight = 0 |
| Memory for the weight.
|
|
template<class T>
class Belle2::TrackFindingCDC::WithWeight< T >
A mixin class to attach a weight to an object.
Definition at line 24 of file WithWeight.h.
◆ Super
template<class T>
using Super = ScalarToClass<T> |
|
private |
◆ WithWeight() [1/2]
Also forward the copy constructor form the base class object.
Definition at line 35 of file WithWeight.h.
◆ WithWeight() [2/2]
Constructor which may also initialise the weight to a desired value.
Definition at line 41 of file WithWeight.h.
42 : Super(t)
43 , m_weight(weight)
44 {
45 }
◆ getWeight()
template<class T>
Weight getWeight |
( |
| ) |
const |
|
inline |
Getter for the weight.
Definition at line 58 of file WithWeight.h.
59 {
60 return m_weight;
61 }
◆ operator<()
template<class T>
bool operator< |
( |
const WithWeight< T > & | other | ) |
const |
|
inline |
Comparison operator establishing an ordering considering the pointer first and the weight second.
Definition at line 48 of file WithWeight.h.
49 {
50
51 const T& t(*this);
52
53 const T& otherT(other);
54 return t < otherT or (not(otherT < t) and getWeight() < other.getWeight());
55 }
◆ setWeight()
template<class T>
void setWeight |
( |
Weight | weight | ) |
|
|
inline |
Setter for the weight of the object.
Definition at line 64 of file WithWeight.h.
65 {
66 m_weight = weight;
67 }
◆ weight()
Mutable getter for the weight.
Definition at line 70 of file WithWeight.h.
71 {
72 return m_weight;
73 }
◆ m_weight
The documentation for this class was generated from the following file: