OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Column< T > Struct Template Reference

#include <OmniSciTypes.h>

Public Member Functions

DEVICE T & operator[] (const unsigned int index) const
 
DEVICE int64_t size () const
 
DEVICE bool isNull (int64_t index) const
 
DEVICE void setNull (int64_t index)
 
DEVICE Column< T > & operator= (const Column< T > &other)
 

Public Attributes

T * ptr_
 
int64_t size_
 

Detailed Description

template<typename T>
struct Column< T >

Definition at line 151 of file OmniSciTypes.h.

Member Function Documentation

template<typename T>
DEVICE bool Column< T >::isNull ( int64_t  index) const
inline

Definition at line 169 of file OmniSciTypes.h.

References is_null(), and Column< T >::ptr_.

Referenced by row_adder().

169 { return is_null(ptr_[index]); }
T * ptr_
Definition: OmniSciTypes.h:152
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
DEVICE Column<T>& Column< T >::operator= ( const Column< T > &  other)
inline

Definition at line 172 of file OmniSciTypes.h.

References i, Column< T >::ptr_, Column< T >::size(), and omnisci.dtypes::T.

172  {
173 #ifndef __CUDACC__
174  if (size() == other.size()) {
175  memcpy(ptr_, &other[0], other.size() * sizeof(T));
176  } else {
177  throw std::runtime_error("cannot copy assign columns with different sizes");
178  }
179 #else
180  if (size() == other.size()) {
181  for (unsigned int i = 0; i < size(); i++) {
182  ptr_[i] = other[i];
183  }
184  } else {
185  // TODO: set error
186  }
187 #endif
188  return *this;
189  }
DEVICE int64_t size() const
Definition: OmniSciTypes.h:167
T * ptr_
Definition: OmniSciTypes.h:152

+ Here is the call graph for this function:

template<typename T>
DEVICE T& Column< T >::operator[] ( const unsigned int  index) const
inline

Definition at line 155 of file OmniSciTypes.h.

References Column< T >::ptr_, set_null(), Column< T >::size_, and omnisci.dtypes::T.

155  {
156  if (index >= size_) {
157 #ifndef __CUDACC__
158  throw std::runtime_error("column buffer index is out of range");
159 #else
160  static T null_value;
161  set_null(null_value);
162  return null_value;
163 #endif
164  }
165  return ptr_[index];
166  }
T * ptr_
Definition: OmniSciTypes.h:152
CONSTEXPR DEVICE void set_null(T &value)
int64_t size_
Definition: OmniSciTypes.h:153

+ Here is the call graph for this function:

template<typename T>
DEVICE void Column< T >::setNull ( int64_t  index)
inline

Definition at line 170 of file OmniSciTypes.h.

References Column< T >::ptr_, and set_null().

Referenced by row_adder().

170 { set_null(ptr_[index]); }
T * ptr_
Definition: OmniSciTypes.h:152
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T>
DEVICE int64_t Column< T >::size ( ) const
inline

Definition at line 167 of file OmniSciTypes.h.

References Column< T >::size_.

Referenced by QueryOutputBufferMemoryManager::allocate_output_buffers(), column_list_first_last(), column_list_get__cpu_(), get_max_with_row_offset(), Column< T >::operator=(), row_adder(), row_addsub(), and row_copier().

167 { return size_; }
int64_t size_
Definition: OmniSciTypes.h:153

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T>
T* Column< T >::ptr_
template<typename T>
int64_t Column< T >::size_

Definition at line 153 of file OmniSciTypes.h.

Referenced by Column< T >::operator[](), and Column< T >::size().


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