OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 47 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 48 of file TopKRuntime.cpp.

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

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 56 of file TopKRuntime.cpp.

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

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

Member Data Documentation

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

Definition at line 77 of file TopKRuntime.cpp.

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

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

Definition at line 76 of file TopKRuntime.cpp.

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

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

Definition at line 78 of file TopKRuntime.cpp.

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

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

Definition at line 79 of file TopKRuntime.cpp.

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


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