Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JComparable< JFirst_t, JSecond_t > Struct Template Reference

Template definition of auxiliary base class for comparison of data structures. More...

#include <JComparable.hh>

Inheritance diagram for JLANG::JComparable< JFirst_t, JSecond_t >:
JAANET::JEvtWeightFactorConstant< JFlux > JTOOLS::JTuple< JHead_t > JTOOLS::JTuple< JTail_t > JAANET::JEvtCategory JAANET::JEvtCategoryHelper JAANET::JEvtWeightFactorConstant< JEvtWeightFactor_t > JACOUSTICS::JTransmission_t JDATABASE::JLocation_t JDATABASE::JRun_t JDATABASE::JRun_t JDATABASE::JRun_t JDETECTOR::JDetectorParameters JDETECTOR::JLocation JDETECTOR::JPMTAddress JDETECTOR::JPMTPhysicalAddress JDETECTOR::JPMTReadoutAddress JDETECTOR::JVersion JEEP::JDate< JSeparator_t > JEEP::JTime< JSeparator_t > JEEP::JVersion JFIT::JEnergy JMATH::JNumber< T > JPARSER::JCounter JPARSER::JCounter JSUPPORT::JLimit JSUPPORT::JLimit JSYSTEM::JDateAndTime JTOOLS::JMultiKey< N, JKey_t > JTOOLS::JMultiKey< 1, JKey_t > JTOOLS::JMultiKey< 2, JKey_t > JTOOLS::JTuple< T > JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > > JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >

Friends

bool operator< (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Less than operator.
 
bool operator< (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Less than operator.
 
bool operator> (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Greater than operator.
 
bool operator> (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Greater than operator.
 
bool operator<= (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Less than or equal operator.
 
bool operator<= (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Less than or equal operator.
 
bool operator>= (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Greater than or equal operator.
 
bool operator>= (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Greater than or equal operator.
 
bool operator== (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Equal operator.
 
bool operator== (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Equal operator.
 
bool operator!= (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Not equal operator.
 
bool operator!= (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Not equal operator.
 

Detailed Description

template<class JFirst_t, class JSecond_t>
struct JLANG::JComparable< JFirst_t, JSecond_t >

Template definition of auxiliary base class for comparison of data structures.

Specialisation of class JComparable for two data types.

The various specialisations of this class implement the operators < > <= >= == != .

The first template parameter should have the corresponding member methods:

      bool less(const JSecond_t&) const;
      bool more(const JSecond_t&) const;

where JFirst_t andd JSecond_t refers to the first and second template parameter, respectively. The second template parameter may be a primitive data type. This class uses in-class friend operators (see Barton-Nackman trick).

Definition at line 138 of file JComparable.hh.

Friends And Related Symbol Documentation

◆ operator< [1/2]

template<class JFirst_t , class JSecond_t >
bool operator< ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Less than operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is less than second object; else false

Definition at line 147 of file JComparable.hh.

149 {
150 return first.less(second);
151 }

◆ operator< [2/2]

template<class JFirst_t , class JSecond_t >
bool operator< ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Less than operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is less than second object; else false

Definition at line 161 of file JComparable.hh.

163 {
164 return second.more(first);
165 }

◆ operator> [1/2]

template<class JFirst_t , class JSecond_t >
bool operator> ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Greater than operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is greater than second object; else false

Definition at line 175 of file JComparable.hh.

177 {
178 return first.more(second);
179 }

◆ operator> [2/2]

template<class JFirst_t , class JSecond_t >
bool operator> ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Greater than operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is greater than second object; else false

Definition at line 189 of file JComparable.hh.

191 {
192 return second.less(first);
193 }

◆ operator<= [1/2]

template<class JFirst_t , class JSecond_t >
bool operator<= ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Less than or equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is less than or equal to second object; else false

Definition at line 203 of file JComparable.hh.

205 {
206 return !first.more(second);
207 }

◆ operator<= [2/2]

template<class JFirst_t , class JSecond_t >
bool operator<= ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Less than or equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is less than or equal to second object; else false

Definition at line 217 of file JComparable.hh.

219 {
220 return second.more(first);
221 }

◆ operator>= [1/2]

template<class JFirst_t , class JSecond_t >
bool operator>= ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Greater than or equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is greater than or equal to second object; else false

Definition at line 231 of file JComparable.hh.

233 {
234 return !first.less(second);
235 }

◆ operator>= [2/2]

template<class JFirst_t , class JSecond_t >
bool operator>= ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Greater than or equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if first object is greater than or equal to second object; else false

Definition at line 245 of file JComparable.hh.

248 {
249 return second.less(first);
250 }

◆ operator== [1/2]

template<class JFirst_t , class JSecond_t >
bool operator== ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are equal; else false

Definition at line 260 of file JComparable.hh.

262 {
263 return !first.less(second) && !first.more(second);
264 }

◆ operator== [2/2]

template<class JFirst_t , class JSecond_t >
bool operator== ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are equal; else false

Definition at line 274 of file JComparable.hh.

277 {
278 return !second.less(first) && !second.more(first);
279 }

◆ operator!= [1/2]

template<class JFirst_t , class JSecond_t >
bool operator!= ( const JFirst_t & first,
typename JClass< JSecond_t >::argument_type second )
friend

Not equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are not equal; else false

Definition at line 289 of file JComparable.hh.

291 {
292 return first.less(second) || first.more(second);
293 }

◆ operator!= [2/2]

template<class JFirst_t , class JSecond_t >
bool operator!= ( typename JClass< JSecond_t >::argument_type first,
const JFirst_t & second )
friend

Not equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are not equal; else false

Definition at line 303 of file JComparable.hh.

305 {
306 return second.less(first) || second.more(first);
307 }

The documentation for this struct was generated from the following file: