Public Member Functions | Public Attributes | List of all members
cudf::detail::optional_accessor< T, Nullate > Struct Template Reference

optional accessor of a column More...

Public Member Functions

 optional_accessor (column_device_view const &_col, Nullate with_nulls)
 Constructor. More...
 
thrust::optional< T > operator() (cudf::size_type i) const
 Returns a thrust::optional of column[i]. More...
 

Public Attributes

column_device_view const col
 column view of column in device
 
Nullate has_nulls {}
 Indicates if the col should be checked for nulls.
 

Detailed Description

template<typename T, typename Nullate>
struct cudf::detail::optional_accessor< T, Nullate >

optional accessor of a column

The optional_accessor always returns a thrust::optional of column[i]. The validity of the optional is determined by the Nullate parameter which may be one of the following:

Exceptions
cudf::logic_errorif column datatype and template T type mismatch.
cudf::logic_errorif the column is not nullable and with_nulls evaluates to true
Template Parameters
TThe type of elements in the column
NullateA cudf::nullate type describing how to check for nulls.

Definition at line 1298 of file column_device_view.cuh.

Constructor & Destructor Documentation

◆ optional_accessor()

template<typename T , typename Nullate >
cudf::detail::optional_accessor< T, Nullate >::optional_accessor ( column_device_view const &  _col,
Nullate  with_nulls 
)
inline

Constructor.

Parameters
_colColumn on which to iterator over its elements.
with_nullsIndicates if the col should be checked for nulls.

Definition at line 1307 of file column_device_view.cuh.

Member Function Documentation

◆ operator()()

template<typename T , typename Nullate >
thrust::optional<T> cudf::detail::optional_accessor< T, Nullate >::operator() ( cudf::size_type  i) const
inline

Returns a thrust::optional of column[i].

Parameters
iThe index of the element to return
Returns
A thrust::optional that contains the value of column[i] is not null. If that element is null, the resulting optional will not contain a value.

Definition at line 1321 of file column_device_view.cuh.


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