OmniSciDB  d2f719934e
 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

constnull_value_
 
constnull_value_mapped_
 

Detailed Description

template<typename T>
struct SortDesc< T >

Definition at line 584 of file TableFunctionsTesting.hpp.

Constructor & Destructor Documentation

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

Definition at line 585 of file TableFunctionsTesting.hpp.

586  : null_value_(std::numeric_limits<T>::lowest())
587  , 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 588 of file TableFunctionsTesting.hpp.

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

Definition at line 592 of file TableFunctionsTesting.hpp.

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

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

592  {
593  return val == null_value_ ? null_value_mapped_ : val;
594  }
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 596 of file TableFunctionsTesting.hpp.

References SortDesc< T >::mapValue().

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

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 597 of file TableFunctionsTesting.hpp.

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

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

Definition at line 598 of file TableFunctionsTesting.hpp.

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


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