Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Mantid::DataObjects::PeakComparator Class Reference

Comparator class for sorting peaks by one or more criteria. More...

Public Types

using ColumnAndDirection = LeanElasticPeaksWorkspace::ColumnAndDirection
 
using ColumnAndDirection = PeaksWorkspace::ColumnAndDirection
 

Public Member Functions

bool operator() (const LeanElasticPeak &a, const LeanElasticPeak &b)
 Compare two peaks using the stored criteria. More...
 
bool operator() (const Peak &a, const Peak &b)
 Compare two peaks using the stored criteria. More...
 
 PeakComparator (std::vector< ColumnAndDirection > &criteria)
 Constructor for the comparator for sorting peaks. More...
 
 PeakComparator (std::vector< ColumnAndDirection > &criteria)
 Constructor for the comparator for sorting peaks. More...
 

Public Attributes

std::vector< ColumnAndDirection > & criteria
 

Detailed Description

Comparator class for sorting peaks by one or more criteria.

Definition at line 60 of file LeanElasticPeaksWorkspace.cpp.

Member Typedef Documentation

◆ ColumnAndDirection [1/2]

Definition at line 62 of file LeanElasticPeaksWorkspace.cpp.

◆ ColumnAndDirection [2/2]

Definition at line 62 of file PeaksWorkspace.cpp.

Constructor & Destructor Documentation

◆ PeakComparator() [1/2]

Mantid::DataObjects::PeakComparator::PeakComparator ( std::vector< ColumnAndDirection > &  criteria)
inlineexplicit

Constructor for the comparator for sorting peaks.

Parameters
criteria: a vector with a list of pairs: column name, bool; where bool = true for ascending, false for descending sort.

Definition at line 69 of file LeanElasticPeaksWorkspace.cpp.

◆ PeakComparator() [2/2]

Mantid::DataObjects::PeakComparator::PeakComparator ( std::vector< ColumnAndDirection > &  criteria)
inlineexplicit

Constructor for the comparator for sorting peaks.

Parameters
criteria: a vector with a list of pairs: column name, bool; where bool = true for ascending, false for descending sort.

Definition at line 69 of file PeaksWorkspace.cpp.

Member Function Documentation

◆ operator()() [1/2]

bool Mantid::DataObjects::PeakComparator::operator() ( const LeanElasticPeak a,
const LeanElasticPeak b 
)
inline

Compare two peaks using the stored criteria.

Definition at line 72 of file LeanElasticPeaksWorkspace.cpp.

References criteria, and Mantid::DataObjects::BasePeak::getValueByColName().

◆ operator()() [2/2]

bool Mantid::DataObjects::PeakComparator::operator() ( const Peak a,
const Peak b 
)
inline

Compare two peaks using the stored criteria.

Definition at line 72 of file PeaksWorkspace.cpp.

References criteria, Mantid::DataObjects::Peak::getBankName(), and Mantid::DataObjects::Peak::getValueByColName().

Member Data Documentation

◆ criteria

std::vector< ColumnAndDirection > & Mantid::DataObjects::PeakComparator::criteria

Definition at line 63 of file LeanElasticPeaksWorkspace.cpp.

Referenced by operator()().


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