HiPipe
0.7.0
C++17 data pipeline with Python bindings.
|
Implementation stub of a column defined by HIPIPE_DEFINE_COLUMN macro. More...
#include <hipipe/core/stream/column_t.hpp>
Public Types | |
using | example_type = ExampleType |
The type of a single example. | |
using | data_type = std::vector< example_type > |
The type of multiple examples. This is what the column actually stores. | |
Public Member Functions | |
template<typename... Args> | |
column_base (Args &&... args) | |
The constructor. More... | |
std::size_t | size () const override |
Get the number of examples in this column. | |
std::unique_ptr< abstract_column > | take (std::size_t n) override |
Steal the given number of examples from this column and create a new column out of those. More... | |
void | push_back (std::unique_ptr< abstract_column > rhs) override |
Concatenate the examples from two columns of the same type. More... | |
data_type & | data () |
Get a reference to the stored vector of examples. | |
const data_type & | data () const |
Get a const reference to the stored vector of examples. | |
Public Member Functions inherited from hipipe::stream::abstract_column | |
template<typename Column > | |
Column::data_type & | extract () |
template<typename Column > | |
const Column::data_type & | extract () const |
virtual std::string | name () const =0 |
Implementation stub of a column defined by HIPIPE_DEFINE_COLUMN macro.
Definition at line 126 of file column_t.hpp.
|
inline |
The constructor.
The constructor forwards its arguments to the constructor of the data_type.
Definition at line 151 of file column_t.hpp.
|
inlineoverridevirtual |
Concatenate the examples from two columns of the same type.
Example:
rhs | The column whose examples will be appended. It needs to be the same type (i.e., the same ColumnName) as this column. |
Implements hipipe::stream::abstract_column.
Definition at line 210 of file column_t.hpp.
|
inlineoverridevirtual |
Steal the given number of examples from this column and create a new column out of those.
Example:
Developer TODO: At the moment, this operation has linear complexity. Maybe we could store the data as a std::deque instead of std::vector.
n | The number of examples to steal. |
std::runtime_error | If attempting to take more than there is. |
Implements hipipe::stream::abstract_column.
Definition at line 181 of file column_t.hpp.