OmniSciDB  c0231cc57d
 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
 
const char * getCString () 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 239 of file heavydbTypes.h.

Constructor & Destructor Documentation

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

Definition at line 245 of file heavydbTypes.h.

References ptr_, and size_.

245  {
246  // Note this will only be valid for the
247  // lifetime of the string
248  ptr_ = const_cast<char*>(str.data());
249  size_ = str.length();
250  }

Member Function Documentation

const char* TextEncodingNone::getCString ( ) const
inline

Definition at line 253 of file heavydbTypes.h.

References ptr_.

253 { return ptr_; }
std::string TextEncodingNone::getString ( ) const
inline

Definition at line 252 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(), linear_reg_predict__cpu_template(), tf_geo_rasterize__cpu_template(), and tf_geo_rasterize_slope__cpu_template().

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

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE bool TextEncodingNone::isNull ( ) const
inline

Definition at line 276 of file heavydbTypes.h.

References size_.

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

Definition at line 274 of file heavydbTypes.h.

References ptr_.

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

Definition at line 251 of file heavydbTypes.h.

References ptr_, and size_.

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

Definition at line 271 of file heavydbTypes.h.

References operator==().

271  {
272  return !(this->operator==(rhs));
273  }
DEVICE ALWAYS_INLINE bool operator==(const char *rhs) const
Definition: heavydbTypes.h:259

+ Here is the call graph for this function:

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

Definition at line 259 of file heavydbTypes.h.

References ptr_, and size_.

Referenced by operator!=().

259  {
260 #ifdef __CUDACC__
261  for (int i = 0; i < size_; i++) {
262  if (rhs[i] == '\0' || ptr_[i] != rhs[i]) {
263  return false;
264  }
265  }
266  return rhs[size_] == '\0';
267 #else
268  return strcmp(ptr_, rhs) == 0;
269 #endif
270  }

+ Here is the caller graph for this function:

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

Definition at line 256 of file heavydbTypes.h.

References ptr_, and size_.

256  {
257  return index < size_ ? ptr_[index] : ptr_[size_ - 1];
258  }
DEVICE ALWAYS_INLINE int64_t TextEncodingNone::size ( ) const
inline

Definition at line 275 of file heavydbTypes.h.

References size_.

Referenced by ct_get_string_chars__template(), and ct_hamming_distance().

275 { 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: