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

#include <TableFunctionsTesting.hpp>

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 768 of file TableFunctionsTesting.hpp.

Constructor & Destructor Documentation

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

Definition at line 769 of file TableFunctionsTesting.hpp.

770  : null_value_(std::numeric_limits<T>::lowest())
771  , null_value_mapped_(map_null_value(nulls_last)) {}
const T null_value_mapped_
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 772 of file TableFunctionsTesting.hpp.

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

Definition at line 776 of file TableFunctionsTesting.hpp.

References SortDesc< T >::null_value_, and SortDesc< T >::null_value_mapped_.

Referenced by SortDesc< T >::operator()().

776  {
777  return val == null_value_ ? null_value_mapped_ : val;
778  }
const T null_value_mapped_

+ Here is the caller graph for this function:

template<typename T >
bool SortDesc< T >::operator() ( const T &  a,
const T &  b 
)
inline

Definition at line 780 of file TableFunctionsTesting.hpp.

References SortDesc< T >::mapValue().

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

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 781 of file TableFunctionsTesting.hpp.

Referenced by SortDesc< T >::mapValue().

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

Definition at line 782 of file TableFunctionsTesting.hpp.

Referenced by SortDesc< T >::mapValue().


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