Cmp< Projection > Class Template Reference Specialization of Cmp for checking the ordering of two {Projection}s. More...
Collaboration diagram for Cmp< Projection >:
![]()
Detailed Descriptiontemplate<>
|
Cmp | ( | const Projection & | p1, |
const Projection & | p2 | ||
) | [inline] |
~Cmp | ( | ) | [inline] |
void _compare | ( | ) | const [inline, private] |
Perform the actual comparison if necessary.
Definition at line 165 of file Cmp.hh.
References Cmp< T >::_objects, Cmp< T >::_value, Rivet::EQUIVALENT, Rivet::ORDERED, Rivet::UNDEFINED, and Rivet::UNORDERED.
{ if (_value == UNDEFINED) { const std::type_info& id1 = typeid(*_objects.first); const std::type_info& id2 = typeid(*_objects.second); if (id1.before(id2)) _value = ORDERED; else if (id2.before(id1)) _value = UNORDERED; else { int c = _objects.first->compare(*_objects.second); if (c < 0) _value = ORDERED; else if (c > 0) _value = UNORDERED; else _value = EQUIVALENT; } } }
operator CmpState | ( | ) | const [inline] |
Automatically convert to an enum.
Definition at line 142 of file Cmp.hh.
References Cmp< T >::_compare(), and Cmp< T >::_value.
operator int | ( | ) | const [inline] |
Automatically convert to an integer.
Definition at line 149 of file Cmp.hh.
References Cmp< T >::_compare(), and Cmp< T >::_value.
const Cmp<Projection>& operator= | ( | const Cmp< U > & | x | ) | [inline] |
The assignment operator.
Definition at line 133 of file Cmp.hh.
References Cmp< T >::_value.
{ _value = x; return *this; }
const Cmp<Projection>& operator|| | ( | const Cmp< U > & | c | ) | const [inline] |
If this state is equivalent, set this state to the state of c.
Definition at line 156 of file Cmp.hh.
References Cmp< T >::_compare(), Cmp< T >::_value, and Rivet::EQUIVALENT.
{ _compare(); if (_value == EQUIVALENT) _value = c; return *this; }
pair<const Projection*, const Projection*> _objects [private] |