OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TextEncodingNone Struct Reference

#include <heavydbTypes.h>

Public Member Functions

 TextEncodingNone ()=default
 
 TextEncodingNone (const std::string &str)
 
 operator std::string () const
 
std::string getString () const
 
DEVICE ALWAYS_INLINE char & operator[] (const unsigned int index)
 
DEVICE ALWAYS_INLINE bool operator== (const char *rhs) const
 
DEVICE ALWAYS_INLINE bool operator!= (const char *rhs) const
 
DEVICE ALWAYS_INLINE operator char * () const
 
DEVICE ALWAYS_INLINE int64_t size () const
 
DEVICE ALWAYS_INLINE bool isNull () const
 

Public Attributes

char * ptr_
 
int64_t size_
 

Detailed Description

Definition at line 173 of file heavydbTypes.h.

Constructor & Destructor Documentation

TextEncodingNone::TextEncodingNone ( )
default
TextEncodingNone::TextEncodingNone ( const std::string &  str)
inline

Definition at line 179 of file heavydbTypes.h.

References ptr_, and size_.

179  {
180  // Note this will only be valid for the
181  // lifetime of the string
182  ptr_ = const_cast<char*>(str.data());
183  size_ = str.length();
184  }

Member Function Documentation

std::string TextEncodingNone::getString ( ) const
inline

Definition at line 186 of file heavydbTypes.h.

References ptr_, and size_.

Referenced by ct_pushdown_stats__cpu_template(), ct_string_concat__cpu_(), ct_string_to_chars__cpu_(), ct_union_pushdown_stats__cpu_template(), dbscan__cpu_template(), kmeans__cpu_template(), linear_reg_fit__cpu_template(), and linear_reg_predict__cpu_template().

186 { return std::string(ptr_, size_); }

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE bool TextEncodingNone::isNull ( ) const
inline

Definition at line 209 of file heavydbTypes.h.

References size_.

209 { return size_ == 0; }
DEVICE ALWAYS_INLINE TextEncodingNone::operator char * ( ) const
inline

Definition at line 207 of file heavydbTypes.h.

References ptr_.

207 { return ptr_; }
TextEncodingNone::operator std::string ( ) const
inline

Definition at line 185 of file heavydbTypes.h.

References ptr_, and size_.

185 { return std::string(ptr_, size_); }
DEVICE ALWAYS_INLINE bool TextEncodingNone::operator!= ( const char *  rhs) const
inline

Definition at line 204 of file heavydbTypes.h.

References operator==().

204  {
205  return !(this->operator==(rhs));
206  }
DEVICE ALWAYS_INLINE bool operator==(const char *rhs) const
Definition: heavydbTypes.h:192

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE bool TextEncodingNone::operator== ( const char *  rhs) const
inline

Definition at line 192 of file heavydbTypes.h.

References ptr_, and size_.

Referenced by operator!=().

192  {
193 #ifdef __CUDACC__
194  for (int i = 0; i < size_; i++) {
195  if (rhs[i] == '\0' || ptr_[i] != rhs[i]) {
196  return false;
197  }
198  }
199  return rhs[size_] == '\0';
200 #else
201  return strcmp(ptr_, rhs) == 0;
202 #endif
203  }

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE char& TextEncodingNone::operator[] ( const unsigned int  index)
inline

Definition at line 189 of file heavydbTypes.h.

References ptr_, and size_.

189  {
190  return index < size_ ? ptr_[index] : ptr_[size_ - 1];
191  }
DEVICE ALWAYS_INLINE int64_t TextEncodingNone::size ( ) const
inline

Definition at line 208 of file heavydbTypes.h.

References size_.

Referenced by ct_get_string_chars__template(), and ct_hamming_distance().

208 { return size_; }

+ Here is the caller graph for this function:

Member Data Documentation

char* TextEncodingNone::ptr_
int64_t TextEncodingNone::size_

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