casacore
Public Member Functions | List of all members
casacore::BaseCompare Class Referenceabstract

abstract base class for comparing two objects More...

#include <Compare.h>

Public Member Functions

virtual ~BaseCompare ()
 
virtual int comp (const void *obj1, const void *obj2) const =0
 Compare two objects, and return. More...
 
virtual DataType dataType () const
 Get the data type of a straight-forward sort comparison in ObjCompare. More...
 

Detailed Description

abstract base class for comparing two objects

Intended use:

Public interface

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/02/24

Synopsis

The abstract class BaseCompare<T> is used for comparisons in sorting or iterating. One can derive a concrete comparison class from it.

Definition at line 64 of file Compare.h.

Constructor & Destructor Documentation

◆ ~BaseCompare()

virtual casacore::BaseCompare::~BaseCompare ( )
inlinevirtual

Definition at line 67 of file Compare.h.

Member Function Documentation

◆ comp()

virtual int casacore::BaseCompare::comp ( const void *  obj1,
const void *  obj2 
) const
pure virtual

Compare two objects, and return.

  • -1 if obj1 < obj2;
  • 0 if obj1 == obj2;
  • 1 otherwise.

Implemented in casacore::MSInterval, casacore::CompareAlwaysTrue, casacore::CompareNoCase, casacore::CompareIntervalReal< T >, casacore::CompareIntervalInt< T >, and casacore::ObjCompare< T >.

◆ dataType()

virtual DataType casacore::BaseCompare::dataType ( ) const
inlinevirtual

Get the data type of a straight-forward sort comparison in ObjCompare.

It is used to test if a the faster GenSortIndirect can be used. By default it returns TpOther.

Reimplemented in casacore::ObjCompare< T >.

Definition at line 81 of file Compare.h.


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