Jpp
Public Member Functions | Public Attributes | List of all members
JTOOLS::JHashSet< JElement_t, JEvaluator_t >::JComparator Struct Reference

Auxiliary class for ordering of objects in the set by the hash value. More...

#include <JHashSet.hh>

Public Member Functions

 JComparator (const JEvaluator_t &evaluator=JEvaluator_t())
 Constructor. More...
 
bool operator() (typename JClass< value_type >::argument_type first, typename JClass< value_type >::argument_type second) const
 Comparison of elements. More...
 

Public Attributes

JEvaluator_t getValue
 Function object for evaluation of element. More...
 

Detailed Description

template<class JElement_t, class JEvaluator_t = JHashEvaluator>
struct JTOOLS::JHashSet< JElement_t, JEvaluator_t >::JComparator

Auxiliary class for ordering of objects in the set by the hash value.

Definition at line 55 of file JHashSet.hh.

Constructor & Destructor Documentation

◆ JComparator()

template<class JElement_t , class JEvaluator_t = JHashEvaluator>
JTOOLS::JHashSet< JElement_t, JEvaluator_t >::JComparator::JComparator ( const JEvaluator_t &  evaluator = JEvaluator_t())
inline

Constructor.

Parameters
evaluatorevaluator

Definition at line 62 of file JHashSet.hh.

62  :
63  getValue(evaluator)
64  {}

Member Function Documentation

◆ operator()()

template<class JElement_t , class JEvaluator_t = JHashEvaluator>
bool JTOOLS::JHashSet< JElement_t, JEvaluator_t >::JComparator::operator() ( typename JClass< value_type >::argument_type  first,
typename JClass< value_type >::argument_type  second 
) const
inline

Comparison of elements.

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

Definition at line 74 of file JHashSet.hh.

76  {
77  return this->getValue(first) < this->getValue(second);
78  }

Member Data Documentation

◆ getValue

template<class JElement_t , class JEvaluator_t = JHashEvaluator>
JEvaluator_t JTOOLS::JHashSet< JElement_t, JEvaluator_t >::JComparator::getValue

Function object for evaluation of element.

Definition at line 84 of file JHashSet.hh.


The documentation for this struct was generated from the following file:
JTOOLS::JHashSet::JComparator::getValue
JEvaluator_t getValue
Function object for evaluation of element.
Definition: JHashSet.hh:84