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

#include <heavydbTypes.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)
 
template<>
DEVICE bool isNull (int64_t index) const
 
template<>
DEVICE void setNull (int64_t index)
 

Public Attributes

T * ptr_
 
int64_t size_
 

Detailed Description

template<typename T>
struct Column< T >

Definition at line 453 of file heavydbTypes.h.

Member Function Documentation

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

Definition at line 471 of file heavydbTypes.h.

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

Referenced by GeoRaster< T, Z >::compute(), GeoRaster< T, Z >::computeParallel(), ct_binding_scalar_multiply__cpu_template(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), get_column_metadata(), get_column_min_max(), Column< TextEncodingDict >::getString(), and row_adder().

471 { return is_null(ptr_[index]); }
T * ptr_
Definition: heavydbTypes.h:454
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<>
DEVICE bool Column< Timestamp >::isNull ( int64_t  index) const
inline

Definition at line 567 of file heavydbTypes.h.

References is_null().

567  {
568  return is_null(ptr_[index].time);
569 }
T * ptr_
Definition: heavydbTypes.h:454
CONSTEXPR DEVICE bool is_null(const T &value)

+ Here is the call graph for this function:

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

Definition at line 473 of file heavydbTypes.h.

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

473  {
474 #ifndef __CUDACC__
475  if (size() == other.size()) {
476  memcpy(ptr_, &other[0], other.size() * sizeof(T));
477  } else {
478  throw std::runtime_error("cannot copy assign columns with different sizes");
479  }
480 #else
481  if (size() == other.size()) {
482  for (unsigned int i = 0; i < size(); i++) {
483  ptr_[i] = other[i];
484  }
485  } else {
486  // TODO: set error
487  }
488 #endif
489  return *this;
490  }
DEVICE int64_t size() const
Definition: heavydbTypes.h:469
T * ptr_
Definition: heavydbTypes.h:454

+ 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 457 of file heavydbTypes.h.

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

457  {
458  if (index >= size_) {
459 #ifndef __CUDACC__
460  throw std::runtime_error("column buffer index is out of range");
461 #else
462  auto& null_value = Column_null_value<T>;
463  set_null(null_value);
464  return null_value;
465 #endif
466  }
467  return ptr_[index];
468  }
T * ptr_
Definition: heavydbTypes.h:454
CONSTEXPR DEVICE void set_null(T &value)
int64_t size_
Definition: heavydbTypes.h:455

+ Here is the call graph for this function:

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

Definition at line 472 of file heavydbTypes.h.

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

Referenced by GeoRaster< T, Z >::calculate_slope_and_aspect(), ct_binding_scalar_multiply__cpu_template(), ct_test_nullable(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), GeoRaster< T, Z >::outputDenseColumns(), and row_adder().

472 { set_null(ptr_[index]); }
T * ptr_
Definition: heavydbTypes.h:454
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 572 of file heavydbTypes.h.

References set_null().

572  {
573  set_null(ptr_[index].time);
574 }
T * ptr_
Definition: heavydbTypes.h:454
CONSTEXPR DEVICE void set_null(T &value)

+ Here is the call graph for this function:

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

Definition at line 469 of file heavydbTypes.h.

References Column< T >::size_.

Referenced by TableFunctionManager::allocate_output_buffers(), GeoRaster< T, Z >::calculate_slope_and_aspect(), column_list_first_last(), column_list_get__cpu_(), GeoRaster< T, Z >::compute(), GeoRaster< T, Z >::computeParallel(), ct_add_size_and_mul_alpha(), ct_binding_column2__cpu_template(), ct_binding_scalar_multiply__cpu_template(), ct_binding_str_length__cpu_(), ct_binding_template__cpu_template(), ct_copy_and_add_size(), ct_cursor_named_args__cpu_(), ct_get_string_chars__template(), ct_named_const_output__cpu_template(), ct_named_output__cpu_template(), ct_named_rowmul_output__cpu_template(), ct_named_user_const_output__cpu_template(), ct_pushdown_projection__cpu_template(), ct_pushdown_stats__cpu_template(), ct_sleep1__cpu_(), ct_sleep2(), ct_sparse_add(), ct_test_nullable(), ct_test_preflight_multicursor_qe227__cpu_(), ct_test_preflight_singlecursor_qe227__cpu_(), ct_test_preflight_sizer(), ct_test_preflight_sizer_const(), ct_throw_if_gt_100__cpu_template(), ct_timestamp_add_offset(), ct_timestamp_extract(), ct_timestamp_test_columns_and_scalars__cpu(), ct_timestamp_truncate(), ct_union_pushdown_projection__cpu_template(), ct_union_pushdown_stats__cpu_template(), dbscan__cpu_template(), GeoRaster< T, Z >::GeoRaster(), get_column_metadata(), get_column_min_max(), get_max_with_row_offset__cpu_(), kmeans__cpu_template(), linear_reg_predict__cpu_template(), Column< T >::operator=(), Column< TextEncodingDict >::operator=(), row_adder(), row_addsub(), row_copier(), row_copier2__cpu__(), sort_coefs(), sort_column_limit__cpu_template(), and TableFunctions_Namespace::strip_column_metadata().

469 { return size_; }
int64_t size_
Definition: heavydbTypes.h:455

Member Data Documentation


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