OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SortDesc< T > Struct Template Reference

Public Member Functions

 SortDesc (const bool nulls_last)
 
mapValue (const T &val)
 
bool operator() (const T &a, const T &b)
 

Static Public Member Functions

static T map_null_value (const bool nulls_last)
 

Public Attributes

const T null_value_
 
const T null_value_mapped_
 

Detailed Description

template<typename T>
struct SortDesc< T >

Definition at line 83 of file OtherTestTableFunctions.cpp.

Constructor & Destructor Documentation

template<typename T >
SortDesc< T >::SortDesc ( const bool  nulls_last)
inline

Definition at line 84 of file OtherTestTableFunctions.cpp.

85  : null_value_(std::numeric_limits<T>::lowest())
86  , null_value_mapped_(map_null_value(nulls_last)) {}
static T map_null_value(const bool nulls_last)

Member Function Documentation

template<typename T >
static T SortDesc< T >::map_null_value ( const bool  nulls_last)
inlinestatic

Definition at line 87 of file OtherTestTableFunctions.cpp.

87  {
88  return nulls_last ? std::numeric_limits<T>::lowest() : std::numeric_limits<T>::max();
89  }
template<typename T >
T SortDesc< T >::mapValue ( const T &  val)
inline

Definition at line 91 of file OtherTestTableFunctions.cpp.

91  {
92  return val == null_value_ ? null_value_mapped_ : val;
93  }
template<typename T >
bool SortDesc< T >::operator() ( const T &  a,
const T &  b 
)
inline

Definition at line 95 of file OtherTestTableFunctions.cpp.

95 { return mapValue(a) > mapValue(b); }
T mapValue(const T &val)
constexpr double a
Definition: Utm.h:32

Member Data Documentation

template<typename T >
const T SortDesc< T >::null_value_

Definition at line 96 of file OtherTestTableFunctions.cpp.

template<typename T >
const T SortDesc< T >::null_value_mapped_

Definition at line 97 of file OtherTestTableFunctions.cpp.


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