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

A set of cudf::column's of the same size. More...

#include <table.hpp>

Public Member Functions

 table (table &&)=default
 Move constructor.
 
tableoperator= (table const &)=delete
 
tableoperator= (table &&)=delete
 
 table (table const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Construct a new table by copying the contents of another table. More...
 
 table (std::vector< std::unique_ptr< column >> &&columns)
 Moves the contents from a vector of unique_ptrs to columns to construct a new table. More...
 
 table (table_view view, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Copy the contents of a table_view to construct a new table. More...
 
size_type num_columns () const noexcept
 Returns the number of columns in the table. More...
 
size_type num_rows () const noexcept
 Returns the number of rows. More...
 
std::size_t alloc_size () const
 Returns the total device allocation size of the table's columns in bytes. More...
 
table_view view () const
 Returns an immutable, non-owning table_view of the contents of this table. More...
 
 operator table_view () const
 Conversion operator to an immutable, non-owning table_view of the contents of this table.
 
mutable_table_view mutable_view ()
 Returns a mutable, non-owning mutable_table_view of the contents of this table. More...
 
 operator mutable_table_view ()
 Conversion operator to a mutable, non-owning mutable_table_view of the contents of this table.
 
std::vector< std::unique_ptr< column > > release ()
 Releases ownership of the columns by returning a vector of unique_ptrs to the constituent columns. More...
 
template<typename InputIterator >
table_view select (InputIterator begin, InputIterator end) const
 Returns a table_view built from a range of column indices. More...
 
table_view select (std::vector< cudf::size_type > const &column_indices) const
 Returns a table_view with set of specified columns. More...
 
columnget_column (cudf::size_type column_index)
 Returns a reference to the specified column. More...
 
column const & get_column (cudf::size_type i) const
 Returns a const reference to the specified column. More...
 

Detailed Description

A set of cudf::column's of the same size.

Definition at line 29 of file table.hpp.

Constructor & Destructor Documentation

◆ table() [1/3]

cudf::table::table ( table const &  other,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)
explicit

Construct a new table by copying the contents of another table.

Uses the specified stream and device memory resource for all allocations and copies.

Parameters
otherThe table to copy
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for all device memory allocations

◆ table() [2/3]

cudf::table::table ( std::vector< std::unique_ptr< column >> &&  columns)

Moves the contents from a vector of unique_ptrs to columns to construct a new table.

Parameters
columnsThe vector of unique_ptrs to columns whose contents will be moved into the new table.

◆ table() [3/3]

Copy the contents of a table_view to construct a new table.

Parameters
viewThe view whose contents will be copied to create a new table
streamCUDA stream used for device memory operations.
mrDevice memory resource used for allocating the device memory for the new columns

Member Function Documentation

◆ alloc_size()

std::size_t cudf::table::alloc_size ( ) const

Returns the total device allocation size of the table's columns in bytes.

See also
cudf::column::alloc_size
Returns
The total allocation size in bytes

◆ get_column() [1/2]

column& cudf::table::get_column ( cudf::size_type  column_index)
inline

Returns a reference to the specified column.

Exceptions
std::out_of_rangeIf i is out of the range [0, num_columns)
Parameters
column_indexIndex of the desired column
Returns
A reference to the desired column

Definition at line 176 of file table.hpp.

◆ get_column() [2/2]

column const& cudf::table::get_column ( cudf::size_type  i) const
inline

Returns a const reference to the specified column.

Exceptions
std::out_of_rangeIf i is out of the range [0, num_columns)
Parameters
iIndex of the desired column
Returns
A const reference to the desired column

Definition at line 187 of file table.hpp.

◆ mutable_view()

mutable_table_view cudf::table::mutable_view ( )

Returns a mutable, non-owning mutable_table_view of the contents of this table.

Returns
A mutable, non-owning mutable_table_view of the contents of this table

◆ num_columns()

size_type cudf::table::num_columns ( ) const
inlinenoexcept

Returns the number of columns in the table.

Returns
The number of columns in the table

Definition at line 75 of file table.hpp.

◆ num_rows()

size_type cudf::table::num_rows ( ) const
inlinenoexcept

Returns the number of rows.

Returns
The number of rows

Definition at line 82 of file table.hpp.

◆ release()

std::vector<std::unique_ptr<column> > cudf::table::release ( )

Releases ownership of the columns by returning a vector of unique_ptrs to the constituent columns.

After release(), num_columns() == 0 and num_rows() == 0

Returns
A vector of unique_ptrs to the constituent columns

◆ select() [1/2]

template<typename InputIterator >
table_view cudf::table::select ( InputIterator  begin,
InputIterator  end 
) const
inline

Returns a table_view built from a range of column indices.

Exceptions
std::out_of_rangeIf any index is outside [0, num_columns())
Parameters
beginBeginning of the range
endEnding of the range
Returns
A table_view consisting of columns from the original table specified by the elements of column_indices

Definition at line 144 of file table.hpp.

◆ select() [2/2]

table_view cudf::table::select ( std::vector< cudf::size_type > const &  column_indices) const
inline

Returns a table_view with set of specified columns.

Exceptions
std::out_of_rangeIf any element in column_indices is outside [0, num_columns())
Parameters
column_indicesIndices of columns in the table
Returns
A table_view consisting of columns from the original table specified by the elements of column_indices

Definition at line 162 of file table.hpp.

◆ view()

table_view cudf::table::view ( ) const

Returns an immutable, non-owning table_view of the contents of this table.

Returns
An immutable, non-owning table_view of the contents of this table

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