creaImageIO_lib
creaImageIO::tree::ComparatorWithOrder Struct Referenceabstract

Abstract Comparator whose order can be reversed. More...

#include <creaImageIOTreeComparators.h>

Inheritance diagram for creaImageIO::tree::ComparatorWithOrder:
Collaboration diagram for creaImageIO::tree::ComparatorWithOrder:

Public Member Functions

 ComparatorWithOrder (bool reverse_order=false)
 
virtual ~ComparatorWithOrder ()
 
virtual bool compare (Node *const &, Node *const &)=0
 
virtual bool operator() (Node *const &x, Node *const &y)
 

Public Attributes

bool mReverseOrder
 

Detailed Description

Abstract Comparator whose order can be reversed.

Definition at line 61 of file creaImageIOTreeComparators.h.

Constructor & Destructor Documentation

creaImageIO::tree::ComparatorWithOrder::ComparatorWithOrder ( bool  reverse_order = false)
inline

Definition at line 63 of file creaImageIOTreeComparators.h.

64  : mReverseOrder(reverse_order) {}
virtual creaImageIO::tree::ComparatorWithOrder::~ComparatorWithOrder ( )
inlinevirtual

Definition at line 65 of file creaImageIOTreeComparators.h.

65 {}

Member Function Documentation

virtual bool creaImageIO::tree::ComparatorWithOrder::compare ( Node *const &  ,
Node *const &   
)
pure virtual

Implemented in creaImageIO::tree::StringComparator, creaImageIO::tree::FloatComparator, and creaImageIO::tree::IntComparator.

Referenced by operator()().

Here is the caller graph for this function:

virtual bool creaImageIO::tree::ComparatorWithOrder::operator() ( Node *const &  x,
Node *const &  y 
)
inlinevirtual

Implements creaImageIO::tree::Comparator.

Definition at line 70 of file creaImageIOTreeComparators.h.

References compare(), and mReverseOrder.

71  {
72  if (mReverseOrder) return this->compare(y,x);
73  return this->compare(x,y);
74  };

Here is the call graph for this function:

Member Data Documentation

bool creaImageIO::tree::ComparatorWithOrder::mReverseOrder

Definition at line 74 of file creaImageIOTreeComparators.h.

Referenced by operator()().


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