HiPipe  0.7.0
C++17 data pipeline with Python bindings.
Public Member Functions | List of all members
hipipe::stream::abstract_column Class Referenceabstract

Abstract base class for HiPipe columns. More...

#include <hipipe/core/stream/column_t.hpp>

Inheritance diagram for hipipe::stream::abstract_column:
Inheritance graph
[legend]

Public Member Functions

template<typename Column >
Column::data_type & extract ()
 
template<typename Column >
const Column::data_type & extract () const
 
virtual std::string name () const =0
 
virtual std::size_t size () const =0
 Retrieve the number of examples stored in the column.
 
virtual void push_back (std::unique_ptr< abstract_column > rhs)=0
 
virtual std::unique_ptr< abstract_columntake (std::size_t n)=0
 

Detailed Description

Abstract base class for HiPipe columns.

Definition at line 33 of file column_t.hpp.

Member Function Documentation

◆ extract() [1/2]

template<typename Column >
Column::data_type& hipipe::stream::abstract_column::extract ( )
inline

Extract a reference to the stored data.

Example:

std::unique_ptr<IntCol> col = std::make_unique<IntCol>();
col->data().assign({1, 2, 3});
std::unique_ptr<abstract_column> ab_col = std::move(col);
ab_col->extract<IntCol>() == std::vector<int>({1, 2, 3});
Template Parameters
ColumnThe column that is represented by this abstract column.
Exceptions
std::runtime_errorIf a column not corresponding to the stored one is requested.

Definition at line 69 of file column_t.hpp.

◆ extract() [2/2]

template<typename Column >
const Column::data_type& hipipe::stream::abstract_column::extract ( ) const
inline

Extract a const reference to the stored data.

The same as previous, but returns a const reference.

Definition at line 82 of file column_t.hpp.

◆ name()

virtual std::string hipipe::stream::abstract_column::name ( ) const
pure virtual

Retrieve the name of the stored column.

This function is automatically overriden and returns the string corresponding to the first parameter of HIPIPE_DEFINE_COLUMN macro.

◆ push_back()

virtual void hipipe::stream::abstract_column::push_back ( std::unique_ptr< abstract_column rhs)
pure virtual

Concatenate the data of two columns.

See the corresponding function in column_base class for more info.

Implemented in hipipe::stream::column_base< ColumnName, ExampleType >.

◆ take()

virtual std::unique_ptr<abstract_column> hipipe::stream::abstract_column::take ( std::size_t  n)
pure virtual

Steal the given number of examples and build a new column of them.

See the corresponding function in column_base class for more info.

Implemented in hipipe::stream::column_base< ColumnName, ExampleType >.


The documentation for this class was generated from the following file:
HIPIPE_DEFINE_COLUMN
#define HIPIPE_DEFINE_COLUMN(column_name_, example_type_)
Macro for fast column definition.
Definition: column_t.hpp:250