Public Member Functions | List of all members
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT > Class Template Reference

column_wrapper derived class for wrapping columns of fixed-width elements. More...

#include <column_wrapper.hpp>

Inheritance diagram for cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >:
cudf::test::detail::column_wrapper

Public Member Functions

 fixed_width_column_wrapper ()
 Default constructor initializes an empty column with proper dtype.
 
template<typename InputIterator >
 fixed_width_column_wrapper (InputIterator begin, InputIterator end)
 Construct a non-nullable column of the fixed-width elements in the range [begin,end). More...
 
template<typename InputIterator , typename ValidityIterator >
 fixed_width_column_wrapper (InputIterator begin, InputIterator end, ValidityIterator v)
 Construct a nullable column of the fixed-width elements in the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each element. More...
 
template<typename ElementFrom >
 fixed_width_column_wrapper (std::initializer_list< ElementFrom > elements)
 Construct a non-nullable column of fixed-width elements from an initializer list. More...
 
template<typename ElementFrom >
 fixed_width_column_wrapper (std::initializer_list< ElementFrom > elements, std::initializer_list< bool > validity)
 Construct a nullable column from a list of fixed-width elements using another list to indicate the validity of each element. More...
 
template<typename ValidityIterator , typename ElementFrom >
 fixed_width_column_wrapper (std::initializer_list< ElementFrom > element_list, ValidityIterator v)
 Construct a nullable column from a list of fixed-width elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element. More...
 
template<typename InputIterator >
 fixed_width_column_wrapper (InputIterator begin, InputIterator end, std::initializer_list< bool > const &validity)
 Construct a nullable column of the fixed-width elements in the range [begin,end) using a validity initializer list to indicate the validity of each element. More...
 
template<typename ElementFrom >
 fixed_width_column_wrapper (std::initializer_list< std::pair< ElementFrom, bool >> elements)
 Construct a nullable column from a list of pairs of fixed-width elements and validity booleans of each element. More...
 
- Public Member Functions inherited from cudf::test::detail::column_wrapper
 operator column_view () const
 Implicit conversion operator to column_view. More...
 
 operator mutable_column_view ()
 Implicit conversion operator to mutable_column_view. More...
 
std::unique_ptr< cudf::columnrelease ()
 Releases internal unique_ptr to wrapped column. More...
 

Additional Inherited Members

- Protected Attributes inherited from cudf::test::detail::column_wrapper
std::unique_ptr< cudf::columnwrapped {}
 The wrapped column.
 

Detailed Description

template<typename ElementTo, typename SourceElementT = ElementTo>
class cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >

column_wrapper derived class for wrapping columns of fixed-width elements.

Template Parameters
ElementToThe fixed-width element type that is created
SourceElementTThe fixed-width element type that is used to create elements of type ElementTo

Definition at line 340 of file column_wrapper.hpp.

Constructor & Destructor Documentation

◆ fixed_width_column_wrapper() [1/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename InputIterator >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( InputIterator  begin,
InputIterator  end 
)
inline

Construct a non-nullable column of the fixed-width elements in the range [begin,end).

Example:

// Creates a non-nullable column of INT32 elements with 5 elements: {0, 2, 4, 6, 8}
auto elements = make_counting_transform_iterator(0, [](auto i){return i*2;});
fixed_width_column_wrapper<int32_t> w(elements, elements + 5);

Note: similar to std::vector, this "range" constructor should be used with parentheses () and not braces {}. The latter should only be used for the initializer_list constructors

Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements

Definition at line 375 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [2/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename InputIterator , typename ValidityIterator >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( InputIterator  begin,
InputIterator  end,
ValidityIterator  v 
)
inline

Construct a nullable column of the fixed-width elements in the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each element.

If v[i] == true, element i is valid, else it is null.

Example:

// Creates a nullable column of INT32 elements with 5 elements: {null, 1, null, 3, null}
auto elements = make_counting_transform_iterator(0, [](auto i){return i;});
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;})
fixed_width_column_wrapper<int32_t> w(elements, elements + 5, validity);

Note: similar to std::vector, this "range" constructor should be used with parentheses () and not braces {}. The latter should only be used for the initializer_list constructors

Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
vThe beginning of the sequence of validity indicators

Definition at line 409 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [3/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename ElementFrom >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( std::initializer_list< ElementFrom >  elements)
inline

Construct a non-nullable column of fixed-width elements from an initializer list.

Example:

// Creates a non-nullable INT32 column with 4 elements: {1, 2, 3, 4}
fixed_width_column_wrapper<int32_t> w{{1, 2, 3, 4}};
Parameters
elementsThe list of elements

Definition at line 434 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [4/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename ElementFrom >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( std::initializer_list< ElementFrom >  elements,
std::initializer_list< bool >  validity 
)
inline

Construct a nullable column from a list of fixed-width elements using another list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable INT32 column with 4 elements: {1, NULL, 3, NULL}
fixed_width_column_wrapper<int32_t> w{ {1,2,3,4}, {1, 0, 1, 0}};
Parameters
elementsThe list of elements
validityThe list of validity indicator booleans

Definition at line 457 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [5/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename ValidityIterator , typename ElementFrom >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( std::initializer_list< ElementFrom >  element_list,
ValidityIterator  v 
)
inline

Construct a nullable column from a list of fixed-width elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element.

Example:

// Creates a nullable INT32 column with 4 elements: {NULL, 1, NULL, 3}
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;})
fixed_width_column_wrapper<int32_t> w{ {1,2,3,4}, validity}
Template Parameters
ValidityIteratorDereferencing a ValidityIterator must be convertible to bool
Parameters
element_listThe list of elements
vThe beginning of the sequence of validity indicators

Definition at line 481 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [6/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename InputIterator >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( InputIterator  begin,
InputIterator  end,
std::initializer_list< bool > const &  validity 
)
inline

Construct a nullable column of the fixed-width elements in the range [begin,end) using a validity initializer list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable column of INT32 elements with 5 elements: {null, 1, null, 3, null}
fixed_width_column_wrapper<int32_t> w(elements, elements + 5, {0, 1, 0, 1, 0});
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
validityThe list of validity indicator booleans

Definition at line 505 of file column_wrapper.hpp.

◆ fixed_width_column_wrapper() [7/7]

template<typename ElementTo , typename SourceElementT = ElementTo>
template<typename ElementFrom >
cudf::test::fixed_width_column_wrapper< ElementTo, SourceElementT >::fixed_width_column_wrapper ( std::initializer_list< std::pair< ElementFrom, bool >>  elements)
inline

Construct a nullable column from a list of pairs of fixed-width elements and validity booleans of each element.

The validity of each element is determined by the boolean element in the pair where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable INT32 column with 4 elements: {1, NULL, 3, NULL}
using p = std::pair<int32_t, bool>;
fixed_width_column_wrapper<int32_t> w( p{1, true}, p{2, false}, p{3, true}, p{4, false} );
Parameters
elementsThe list of pairs of element and validity booleans

Definition at line 530 of file column_wrapper.hpp.


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