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))
 Iterator type for the table.
 
using const_iterator = decltype(std::cbegin(_columns))
 const iterator type for the table
 

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. More...
 
const_iterator begin () const noexcept
 Returns an iterator to the first view in the table. More...
 
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. More...
 
size_type num_rows () const noexcept
 Returns the number of rows. More...
 
size_type is_empty () const noexcept
 Returns true if num_columns() returns zero, or false otherwise. More...
 
 table_view_base (table_view_base const &)=default
 Copy constructor.
 
 table_view_base (table_view_base &&)=default
 Move constructor.
 
table_view_baseoperator= (table_view_base const &)=default
 Copy assignment operator. More...
 
table_view_baseoperator= (table_view_base &&)=default
 Move assignment operator. More...
 

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:

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: expects column_view or mutable_column_view

Definition at line 51 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

◆ begin() [1/2]

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

Returns an iterator to the first view in the table.

Returns
An iterator to the first view in the table

Definition at line 95 of file table_view.hpp.

◆ begin() [2/2]

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

Returns an iterator to the first view in the table.

Returns
An iterator to the first column_view

Definition at line 88 of file table_view.hpp.

◆ 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.

Returns
An iterator to one past the last column view in the table

Definition at line 115 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.

Returns
An iterator to one past the last column view in the table

Definition at line 105 of file table_view.hpp.

◆ is_empty()

template<typename ColumnView >
size_type cudf::detail::table_view_base< ColumnView >::is_empty ( ) const
inlinenoexcept

Returns true if num_columns() returns zero, or false otherwise.

Returns
True if num_columns() returns zero, or false otherwise

Definition at line 147 of file table_view.hpp.

◆ num_columns()

template<typename ColumnView >
size_type cudf::detail::table_view_base< ColumnView >::num_columns ( ) const
inlinenoexcept

Returns the number of columns.

Returns
The number of columns

Definition at line 133 of file table_view.hpp.

◆ num_rows()

template<typename ColumnView >
size_type cudf::detail::table_view_base< ColumnView >::num_rows ( ) const
inlinenoexcept

Returns the number of rows.

Returns
The number of rows

Definition at line 140 of file table_view.hpp.

◆ operator=() [1/2]

template<typename ColumnView >
table_view_base& cudf::detail::table_view_base< ColumnView >::operator= ( table_view_base< ColumnView > &&  )
default

Move assignment operator.

Returns
Reference to this object (after transferring ownership)

◆ operator=() [2/2]

template<typename ColumnView >
table_view_base& cudf::detail::table_view_base< ColumnView >::operator= ( table_view_base< ColumnView > const &  )
default

Copy assignment operator.

Returns
Reference to this object

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