ORIGINAL
Loading...
Searching...
No Matches
original::comparator< TYPE > Class Template Referenceabstract

Base class for comparison. More...

#include <comparator.h>

Inheritance diagram for original::comparator< TYPE >:
Inheritance graph
Collaboration diagram for original::comparator< TYPE >:
Collaboration graph

Public Member Functions

virtual ~comparator ()=default
 Virtual destructor for the comparator class.
 
virtual bool compare (const TYPE &t1, const TYPE &t2) const =0
 Pure virtual compare method for comparing two elements.
 
bool operator() (const TYPE &t1, const TYPE &t2) const
 Function call operator for comparing two elements using the compare method.
 

Detailed Description

template<typename TYPE>
class original::comparator< TYPE >

Base class for comparison.

Template Parameters
TYPEType of the elements being compared

This class provides the interface for comparing two elements of type TYPE. Derived classes must implement the compare method to perform the actual comparison logic.

Member Function Documentation

◆ compare()

template<typename TYPE>
virtual bool original::comparator< TYPE >::compare ( const TYPE & t1,
const TYPE & t2 ) const
pure virtual

Pure virtual compare method for comparing two elements.

Parameters
t1The first element to compare.
t2The second element to compare.
Returns
true if t1 has a higher priority than t2, otherwise false.

The compare method must be implemented in derived classes. It is used to determine the priority of two elements, where true indicates that t1 is considered to have a higher priority than t2, and false means t2 has higher priority or they are equal.

Implemented in original::decreaseComparator< TYPE >, original::decreaseNotStrictComparator< TYPE >, original::equalComparator< TYPE >, original::increaseComparator< TYPE >, original::increaseComparator< K_TYPE >, original::increaseNotStrictComparator< TYPE >, and original::notEqualComparator< TYPE >.

◆ operator()()

template<typename TYPE>
auto original::comparator< TYPE >::operator() ( const TYPE & t1,
const TYPE & t2 ) const

Function call operator for comparing two elements using the compare method.

Parameters
t1The first element to compare.
t2The second element to compare.
Returns
Result depends on comparator::compare().

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