Public Types | Public Member Functions | List of all members
cudf::detail::table_view_base< ColumnView > Class Template Reference

Base class for a table of ColumnViews. More...

#include <table_view.hpp>

Public Types

using iterator = decltype(std::begin(_columns))
 
using const_iterator = decltype(std::cbegin(_columns))
 

Public Member Functions

 table_view_base (std::vector< ColumnView > const &cols)
 Construct a table from a vector of column views. More...
 
iterator begin () noexcept
 Returns an iterator to the first view in the table.
 
const_iterator begin () const noexcept
 Returns an iterator to the first view in the table.
 
iterator end () noexcept
 Returns an iterator one past the last column view in the table. More...
 
const_iterator end () const noexcept
 Returns an iterator one past the last column view in the table. More...
 
ColumnView const & column (size_type column_index) const
 Returns a reference to the view of the specified column. More...
 
size_type num_columns () const noexcept
 Returns the number of columns.
 
size_type num_rows () const noexcept
 Returns the number of rows.
 
size_type is_empty () const noexcept
 Returns true if num_columns() returns zero, or false otherwise.
 
 table_view_base (table_view_base const &)=default
 
 table_view_base (table_view_base &&)=default
 
table_view_baseoperator= (table_view_base const &)=default
 
table_view_baseoperator= (table_view_base &&)=default
 

Detailed Description

template<typename ColumnView>
class cudf::detail::table_view_base< ColumnView >

Base class for a table of ColumnViews.

This class should not be used directly. Instead: -table_view should be used for a table of column_views -mutable_table_view should be used for a table of mutable_column_views

All public constructors and member functions of table_view_base are available in both table_view and mutable_table_view.

Template Parameters
ColumnViewThe type of column view the table contains

Definition at line 50 of file table_view.hpp.

Constructor & Destructor Documentation

◆ table_view_base()

template<typename ColumnView >
cudf::detail::table_view_base< ColumnView >::table_view_base ( std::vector< ColumnView > const &  cols)
explicit

Construct a table from a vector of column views.

Note
Because a std::vector is constructible from a std::initializer_list, this constructor also supports the following usage:
column_view c0, c1, c2;
...
table_view t{{c0,c1,c2}}; // Creates a `table` from c0, c1, c2
Exceptions
cudf::logic_errorIf all views do not have the same size
Parameters
colsThe vector of columns to construct the table from

Member Function Documentation

◆ column()

template<typename ColumnView >
ColumnView const& cudf::detail::table_view_base< ColumnView >::column ( size_type  column_index) const

Returns a reference to the view of the specified column.

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

◆ end() [1/2]

template<typename ColumnView >
const_iterator cudf::detail::table_view_base< ColumnView >::end ( ) const
inlinenoexcept

Returns an iterator one past the last column view in the table.

end() acts as a place holder. Attempting to dereference it results in undefined behavior.

Definition at line 106 of file table_view.hpp.

◆ end() [2/2]

template<typename ColumnView >
iterator cudf::detail::table_view_base< ColumnView >::end ( )
inlinenoexcept

Returns an iterator one past the last column view in the table.

end() acts as a place holder. Attempting to dereference it results in undefined behavior.

Definition at line 98 of file table_view.hpp.


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