OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{JoinHashTableInterface.cpp} Namespace Reference

Namespaces

 keyed_hash
 
 perfect_hash
 

Functions

template<typename T >
void innerToString (const int8_t *ptr1, size_t entry_count, size_t key_component_count, bool raw, std::string &txt)
 
template<typename T >
std::string toStringFlat (const JoinHashTableInterface *hash_table, const ExecutorDeviceType device_type, const int device_id)
 

Function Documentation

template<typename T >
void anonymous_namespace{JoinHashTableInterface.cpp}::innerToString ( const int8_t *  ptr1,
size_t  entry_count,
size_t  key_component_count,
bool  raw,
std::string &  txt 
)

Definition at line 73 of file JoinHashTableInterface.cpp.

References to_string().

77  {
78  auto empty = get_empty_key<T>();
79  auto ptr = reinterpret_cast<const T*>(ptr1);
80  for (size_t e = 0; e < entry_count; ++e, ptr += key_component_count) {
81  if (e != 0) {
82  txt += " ";
83  }
84  if (*ptr == empty && !raw) {
85  txt += "*"; // null hash table entry
86  } else if (*ptr == empty - 1 && !raw) {
87  txt += "?"; // write_pending (should never happen here)
88  } else {
89  txt += "(";
90  for (size_t j = 0; j < key_component_count; ++j) {
91  if (j != 0) {
92  txt += ",";
93  }
94  txt += std::to_string(ptr[j]);
95  }
96  txt += ")";
97  }
98  }
99 }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

template<typename T >
std::string anonymous_namespace{JoinHashTableInterface.cpp}::toStringFlat ( const JoinHashTableInterface hash_table,
const ExecutorDeviceType  device_type,
const int  device_id 
)

Definition at line 226 of file JoinHashTableInterface.cpp.

References JoinHashTableInterface::getJoinHashBuffer(), JoinHashTableInterface::getJoinHashBufferSize(), and to_string().

228  {
229  auto mem =
230  reinterpret_cast<const T*>(hash_table->getJoinHashBuffer(device_type, device_id));
231  auto memsz = hash_table->getJoinHashBufferSize(device_type, device_id) / sizeof(T);
232  std::string txt;
233  for (size_t i = 0; i < memsz; ++i) {
234  if (i > 0) {
235  txt += ", ";
236  }
237  txt += std::to_string(mem[i]);
238  }
239  return txt;
240 }
virtual int64_t getJoinHashBuffer(const ExecutorDeviceType device_type, const int device_id=0) const noexcept=0
std::string to_string(char const *&&v)
virtual size_t getJoinHashBufferSize(const ExecutorDeviceType device_type, const int device_id=0) const noexcept=0

+ Here is the call graph for this function: