Public Member Functions | List of all members
cudf::test::strings_column_wrapper Class Reference

column_wrapper derived class for wrapping columns of strings. More...

#include <column_wrapper.hpp>

Inheritance diagram for cudf::test::strings_column_wrapper:
cudf::test::detail::column_wrapper

Public Member Functions

 strings_column_wrapper ()
 Default constructor initializes an empty column of strings.
 
template<typename StringsIterator >
 strings_column_wrapper (StringsIterator begin, StringsIterator end)
 Construct a non-nullable column of strings from the range [begin,end). More...
 
template<typename StringsIterator , typename ValidityIterator >
 strings_column_wrapper (StringsIterator begin, StringsIterator end, ValidityIterator v)
 Construct a nullable column of strings from the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each string. More...
 
 strings_column_wrapper (std::initializer_list< std::string > strings)
 Construct a non-nullable column of strings from a list of strings. More...
 
template<typename ValidityIterator >
 strings_column_wrapper (std::initializer_list< std::string > strings, ValidityIterator v)
 Construct a nullable column of strings from a list of strings and the range [v, v + strings.size()) interpreted as booleans to indicate the validity of each string. More...
 
 strings_column_wrapper (std::initializer_list< std::string > strings, std::initializer_list< bool > validity)
 Construct a nullable column of strings from a list of strings and a list of booleans to indicate the validity of each string. More...
 
 strings_column_wrapper (std::initializer_list< std::pair< std::string, bool >> strings)
 Construct a nullable column from a list of pairs of strings and validity booleans of each string. 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

column_wrapper derived class for wrapping columns of strings.

Definition at line 736 of file column_wrapper.hpp.

Constructor & Destructor Documentation

◆ strings_column_wrapper() [1/6]

template<typename StringsIterator >
cudf::test::strings_column_wrapper::strings_column_wrapper ( StringsIterator  begin,
StringsIterator  end 
)
inline

Construct a non-nullable column of strings from the range [begin,end).

Values in the sequence [begin,end) will each be converted to std::string and a column will be created containing all of the strings.

Example:

// Creates a non-nullable STRING column with 7 string elements:
// {"", "this", "is", "a", "column", "of", "strings"}
std::vector<std::string> strings{"", "this", "is", "a", "column", "of", "strings"};
strings_column_wrapper s(strings.begin(), strings.end());
strings_column_wrapper()
Default constructor initializes an empty column of strings.
Template Parameters
StringsIteratorA std::string must be constructible from dereferencing a StringsIterator.
Parameters
beginThe beginning of the sequence
endThe end of the sequence

Definition at line 764 of file column_wrapper.hpp.

◆ strings_column_wrapper() [2/6]

template<typename StringsIterator , typename ValidityIterator >
cudf::test::strings_column_wrapper::strings_column_wrapper ( StringsIterator  begin,
StringsIterator  end,
ValidityIterator  v 
)
inline

Construct a nullable column of strings from the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each string.

Values in the sequence [begin,end) will each be converted to std::string and a column will be created containing all of the strings.

If v[i] == true, string i is valid, else it is null. If a string *(begin+i) is null, it's value is ignored and treated as an empty string.

Example:

// Creates a nullable STRING column with 7 string elements:
// {NULL, "this", NULL, "a", NULL, "of", NULL}
std::vector<std::string> strings{"", "this", "is", "a", "column", "of", "strings"};
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;});
strings_column_wrapper s(strings.begin(), strings.end(), validity);
Template Parameters
StringsIteratorA std::string must be constructible from dereferencing a StringsIterator.
ValidityIteratorDereferencing a ValidityIterator must be convertible to bool
Parameters
beginThe beginning of the sequence
endThe end of the sequence
vThe beginning of the sequence of validity indicators

Definition at line 813 of file column_wrapper.hpp.

◆ strings_column_wrapper() [3/6]

cudf::test::strings_column_wrapper::strings_column_wrapper ( std::initializer_list< std::string >  strings)
inline

Construct a non-nullable column of strings from a list of strings.

Example:

// Creates a non-nullable STRING column with 7 string elements:
// {"", "this", "is", "a", "column", "of", "strings"}
strings_column_wrapper s({"", "this", "is", "a", "column", "of", "strings"});
Parameters
stringsThe list of strings

Definition at line 848 of file column_wrapper.hpp.

◆ strings_column_wrapper() [4/6]

template<typename ValidityIterator >
cudf::test::strings_column_wrapper::strings_column_wrapper ( std::initializer_list< std::string >  strings,
ValidityIterator  v 
)
inline

Construct a nullable column of strings from a list of strings and the range [v, v + strings.size()) interpreted as booleans to indicate the validity of each string.

Example:

// Creates a nullable STRING column with 7 string elements:
// {NULL, "this", NULL, "a", NULL, "of", NULL}
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;});
strings_column_wrapper s({"", "this", "is", "a", "column", "of", "strings"}, validity);
Template Parameters
ValidityIteratorDereferencing a ValidityIterator must be convertible to bool
Parameters
stringsThe list of strings
vThe beginning of the sequence of validity indicators

Definition at line 872 of file column_wrapper.hpp.

◆ strings_column_wrapper() [5/6]

cudf::test::strings_column_wrapper::strings_column_wrapper ( std::initializer_list< std::string >  strings,
std::initializer_list< bool >  validity 
)
inline

Construct a nullable column of strings from a list of strings and a list of booleans to indicate the validity of each string.

Example:

// Creates a nullable STRING column with 7 string elements:
// {NULL, "this", NULL, "a", NULL, "of", NULL}
strings_column_wrapper s({"", "this", "is", "a", "column", "of", "strings"},
{0,1,0,1,0,1,0});
Parameters
stringsThe list of strings
validityThe list of validity indicator booleans

Definition at line 892 of file column_wrapper.hpp.

◆ strings_column_wrapper() [6/6]

cudf::test::strings_column_wrapper::strings_column_wrapper ( std::initializer_list< std::pair< std::string, bool >>  strings)
inline

Construct a nullable column from a list of pairs of strings and validity booleans of each string.

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

Example:

// Creates a nullable STRING column with 7 string elements:
// {NULL, "this", NULL, "a", NULL, "of", NULL}
using p = std::pair<std::string, bool>;
strings_column_wrapper s( p{"", false}, p{"this", true}, p{"is", false},
p{"a", true}, p{"column", false}, p{"of", true},
p{"strings", false} );
Parameters
stringsThe list of pairs of strings and validity booleans

Definition at line 918 of file column_wrapper.hpp.


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