casacore
Loading...
Searching...
No Matches

More...

#include <Sort.h>

Public Member Functions

 SortKey (const void *data, const std::shared_ptr< BaseCompare > &, uInt increment, int order)
 Define a sort key in a given data array using the indicated comparison object, stride and sort order.
 
 SortKey (const SortKey &)
 Copy constructor (copy semantics).
 
 ~SortKey ()
 
SortKeyoperator= (const SortKey &)
 Assignment (copy semantics).
 
uInt tryGenSort (Vector< uInt > &indexVector, uInt nrrec, int opt) const
 Try if GenSort can be used for this single key.
 
uInt64 tryGenSort (Vector< uInt64 > &indexVector, uInt64 nrrec, int opt) const
 
int order () const
 Get the sort order.
 

Protected Attributes

int order_p
 sort order; -1 = ascending, 1 = descending
 
const void * data_p
 address of first data point
 
uInt incr_p
 increment for next data point
 
std::shared_ptr< BaseCompareccmpObj_p
 comparison object; use std::shared_ptr for memory management
 
BaseComparecmpObj_p
 comparison object; use raw pointer for performance
 

Friends

class Sort
 

Detailed Description

Define a Sort key

Intended use:

Internal

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/03/01
Test programs:
tSort, tSort_1

Synopsis

SortKey is a helper class for the Sort class. It holds the following information about a sort key:

  • Address of the data array containing the sort key;
  • A std::shared_ptr to a comparison object to be used (of a class derived from the abstract base class BaseCompare).
  • Increment for the next data point – this lets you specify a stride for keys embedded in a struct;
  • Sort order – ascending or descending;

Definition at line 57 of file Sort.h.

Constructor & Destructor Documentation

◆ SortKey() [1/2]

casacore::SortKey::SortKey ( const void * data,
const std::shared_ptr< BaseCompare > & ,
uInt increment,
int order )

Define a sort key in a given data array using the indicated comparison object, stride and sort order.

◆ SortKey() [2/2]

casacore::SortKey::SortKey ( const SortKey & )

Copy constructor (copy semantics).

◆ ~SortKey()

casacore::SortKey::~SortKey ( )

Member Function Documentation

◆ operator=()

SortKey & casacore::SortKey::operator= ( const SortKey & )

Assignment (copy semantics).

◆ order()

int casacore::SortKey::order ( ) const
inline

Get the sort order.

Definition at line 82 of file Sort.h.

References order_p.

◆ tryGenSort() [1/2]

uInt casacore::SortKey::tryGenSort ( Vector< uInt > & indexVector,
uInt nrrec,
int opt ) const

Try if GenSort can be used for this single key.

If it succeeds, it returns the resulting number of elements. Otherwise it returns 0.

◆ tryGenSort() [2/2]

uInt64 casacore::SortKey::tryGenSort ( Vector< uInt64 > & indexVector,
uInt64 nrrec,
int opt ) const

Friends And Related Symbol Documentation

◆ Sort

friend class Sort
friend

Definition at line 60 of file Sort.h.

Member Data Documentation

◆ ccmpObj_p

std::shared_ptr<BaseCompare> casacore::SortKey::ccmpObj_p
protected

comparison object; use std::shared_ptr for memory management

Definition at line 93 of file Sort.h.

◆ cmpObj_p

BaseCompare* casacore::SortKey::cmpObj_p
protected

comparison object; use raw pointer for performance

Definition at line 95 of file Sort.h.

◆ data_p

const void* casacore::SortKey::data_p
protected

address of first data point

Definition at line 89 of file Sort.h.

◆ incr_p

uInt casacore::SortKey::incr_p
protected

increment for next data point

Definition at line 91 of file Sort.h.

◆ order_p

int casacore::SortKey::order_p
protected

sort order; -1 = ascending, 1 = descending

Definition at line 87 of file Sort.h.

Referenced by order().


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