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

Public Member Functions

DEVICE KeyComparator (const HeapOrdering hp_order, const bool nullable, const KeyT null_val, const NullsOrdering null_order)
 
ALWAYS_INLINE DEVICE bool operator() (const KeyT lhs, const KeyT rhs) const
 

Public Attributes

const HeapOrdering heap_ordering
 
const bool has_nulls
 
const KeyT null_key
 
const NullsOrdering nulls_ordering
 

Detailed Description

template<typename KeyT = int64_t>
struct KeyComparator< KeyT >

Definition at line 46 of file TopKRuntime.cpp.

Constructor & Destructor Documentation

template<typename KeyT = int64_t>
DEVICE KeyComparator< KeyT >::KeyComparator ( const HeapOrdering  hp_order,
const bool  nullable,
const KeyT  null_val,
const NullsOrdering  null_order 
)
inline

Definition at line 47 of file TopKRuntime.cpp.

51  : heap_ordering(hp_order)
52  , has_nulls(nullable)
53  , null_key(null_val)
54  , nulls_ordering(null_order) {}
const NullsOrdering nulls_ordering
Definition: TopKRuntime.cpp:78
const bool has_nulls
Definition: TopKRuntime.cpp:76
const KeyT null_key
Definition: TopKRuntime.cpp:77
const HeapOrdering heap_ordering
Definition: TopKRuntime.cpp:75

Member Function Documentation

template<typename KeyT = int64_t>
ALWAYS_INLINE DEVICE bool KeyComparator< KeyT >::operator() ( const KeyT  lhs,
const KeyT  rhs 
) const
inline

Definition at line 55 of file TopKRuntime.cpp.

References FIRST, KeyComparator< KeyT >::has_nulls, KeyComparator< KeyT >::heap_ordering, MIN, KeyComparator< KeyT >::null_key, and KeyComparator< KeyT >::nulls_ordering.

55  {
56  if (has_nulls) {
58  if (rhs == null_key) {
59  return true;
60  }
61  if (lhs == null_key) {
62  return false;
63  }
64  } else {
65  if (lhs == null_key) {
66  return true;
67  }
68  if (rhs == null_key) {
69  return false;
70  }
71  }
72  }
73  return heap_ordering == HeapOrdering::MIN ? (lhs < rhs) : (lhs > rhs);
74  }
const NullsOrdering nulls_ordering
Definition: TopKRuntime.cpp:78
const bool has_nulls
Definition: TopKRuntime.cpp:76
const KeyT null_key
Definition: TopKRuntime.cpp:77
const HeapOrdering heap_ordering
Definition: TopKRuntime.cpp:75

Member Data Documentation

template<typename KeyT = int64_t>
const bool KeyComparator< KeyT >::has_nulls

Definition at line 76 of file TopKRuntime.cpp.

Referenced by KeyComparator< KeyT >::operator()().

template<typename KeyT = int64_t>
const HeapOrdering KeyComparator< KeyT >::heap_ordering

Definition at line 75 of file TopKRuntime.cpp.

Referenced by KeyComparator< KeyT >::operator()().

template<typename KeyT = int64_t>
const KeyT KeyComparator< KeyT >::null_key

Definition at line 77 of file TopKRuntime.cpp.

Referenced by KeyComparator< KeyT >::operator()().

template<typename KeyT = int64_t>
const NullsOrdering KeyComparator< KeyT >::nulls_ordering

Definition at line 78 of file TopKRuntime.cpp.

Referenced by KeyComparator< KeyT >::operator()().


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