#include <Column.h>
Binary table column data and metadata.
T | The value type, possibly const-qualified for read-only columns |
N | The field dimension (number of axes) or -1 for runtime dimension |
THolder | The data container, which must meet SizedData requirements |
A column is a contiguous container for the field data of a binary table column. As explained in the ColumnInfo
documentation (make sure to have read it before going further), fields can be made of several values. Template parameter N
is bound to the field category:
N
= 1 for scalar, string and vector columns;N
> 1 for multidimensional columns with fixed dimension;N
= -1 for multidimensional columns with runtime dimension.Column
which owns a data vector (THolder
= std::vector<T>
). More...ColumnInfo
for details on the field properties. make_column()
for creation shortcuts. Public Types | |
using | Info = ColumnInfo< Value, N > |
The info type. | |
using | Value = std::decay_t< T > |
The element value type. | |
Public Types inherited from DataContainer< T, THolder, Column< T, N, THolder > > | |
using | Container = typename Holder::Container |
The concrete container type. | |
using | Holder = THolder |
The concrete data holder type. | |
Public Types inherited from ContiguousContainerMixin< T, TDerived > | |
using | const_iterator = const T * |
The constant value iterator. | |
using | const_reference = const T & |
The constant value reference. | |
using | difference_type = std::ptrdiff_t |
The iterator difference type. | |
using | iterator = T * |
The value iterator. | |
using | reference = T & |
The value reference. | |
using | size_type = std::size_t |
The underlying container size type. | |
using | value_type = T |
The value type. | |
Static Public Attributes | |
static constexpr long | Dim = N |
The dimension parameter. | |
Public Member Functions | |
PtrRaster< T, N > | entry (long row) |
const PtrRaster< const T, N > | entry (long row) const |
long | rowCount () const |
Construction | |
Column () | |
Default constructor. | |
Column (Info info, long row_count=0) | |
Create an empty column with given metadata. More... | |
Column (Info info, long row_count, T *data) | |
Create a column with given metadata and data. More... | |
template<typename... Ts> | |
Column (Info info, Ts &&... args) | |
Create a column with given metadata and data. More... | |
Properties | |
const Info & | info () const |
Get the column metadata. | |
void | rename (const std::string &name) |
Change the column name. | |
void | reshape (long repeat_count=1) |
Change the column repeat count (fold/unfold). More... | |
void | reshape (Position< N > shape) |
Change the field shape. More... | |
long | row_count () const |
Number of rows in the column. | |
Element access | |
const T & | operator() (long row, long repeat=0) const |
Access the value at given row and repeat indices. More... | |
T & | operator() (long row, long repeat=0) |
Access the value at given row and repeat indices. | |
const T & | at (long row, long repeat=0) const |
Access the value at given row and repeat indices. | |
T & | at (long row, long repeat=0) |
Access the value at given row and repeat indices. | |
Views | |
const PtrRaster< const T, N > | field (long row) const |
Access the field at given row index as a raster. | |
PtrRaster< T, N > | field (long row) |
Access the field at given row index as a raster. | |
const PtrColumn< const T, N > | slice (const Segment &rows) const |
Get a view on contiguous rows. | |
PtrColumn< T, N > | slice (const Segment &rows) |
Get a view on contiguous rows. | |
Public Member Functions inherited from DataContainer< T, THolder, Column< T, N, THolder > > | |
DataContainer (TSize s=0, std::remove_const_t< T > *d=nullptr) | |
Construct from a size and non-constant data. | |
DataContainer (TSize s, const T *d) | |
Construct from a size and constant data. | |
DataContainer (TIterator begin, TIterator end) | |
Iterator-based constructor. | |
DataContainer (std::initializer_list< T > values) | |
Value list constructor. | |
DataContainer (TArg0 arg0, TArgs &&... args) | |
Forwarding constructor. | |
T * | data () |
const std::decay_t< Container > & | container () const |
Access the container in read-only mode. | |
Container & | moveTo (Container &destination) |
Move the container. More... | |
Public Member Functions inherited from ContiguousContainerMixin< T, TDerived > | |
bool | empty () const |
Check whether the container is empty. More... | |
const T & | operator[] (size_type index) const |
Access the element with given index. | |
T & | operator[] (size_type index) |
Access the element with given index. | |
const_iterator | begin () const |
Iterator to the first element. | |
iterator | begin () |
Iterator to the first element. | |
const_iterator | cbegin () |
Iterator to the first element. | |
const_iterator | end () const |
Iterator to one past the last element. | |
iterator | end () |
Iterator to one past the last element. | |
const_iterator | cend () |
Iterator to one past the last element. | |
virtual bool | operator== (const TDerived &rhs) const |
Check equality. | |
bool | operator!= (const TDerived &rhs) const |
Check inequality. | |
Public Member Functions inherited from VectorArithmeticMixin< T, TDerived, Incrementable > | |
TDerived & | operator+= (const TDerived &rhs) |
V += U and W = V + U. | |
TDerived & | operator+= (const T &rhs) |
V += a, V = U + a, V = a + U. | |
TDerived & | operator-= (const TDerived &rhs) |
V -= U and W = V - U. | |
TDerived & | operator-= (const T &rhs) |
V -= a, V = U - a, V = a - U. | |
TDerived & | operator*= (const T &rhs) |
V *= a, V = U * a, V = a * U. | |
TDerived & | operator/= (const T &rhs) |
V /= a, V = U / a. | |
template<typename TFunc , typename... TContainers> | |
TDerived & | generate (TFunc &&func, const TContainers &... args) |
Generate values from a function with optional input containers. More... | |
template<typename TFunc , typename... TContainers> | |
TDerived & | apply (TFunc &&func, const TContainers &... args) |
Apply a function with optional input containers. More... | |
TDerived | operator+ () const |
Copy. | |
TDerived | operator- () const |
Compute the opposite. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename TSeq > | |
long | columns_row_count (TSeq &&columns) |
Get the common number of rows of a sequence of columns. More... | |
template<typename T , typename TInfo > | |
PtrColumn< T, std::decay_t< TInfo >::Dim > | make_column (TInfo &&info, long row_count, T *data) |
Pointer specialization. | |
template<typename TInfo , typename TContainer > | |
Column< typename TContainer::value_type, std::decay_t< TInfo >::Dim, DataContainerHolder< typename TContainer::value_type, TContainer > > | make_column (TInfo info, TContainer &&data) |
Shortcut to create a column from a column info and data without specifying the template parameters. More... | |
Related Functions inherited from ContiguousContainerMixin< T, TDerived > | |
template<typename T , typename TDerived > | |
std::ostream & | operator<< (std::ostream &os, const ContiguousContainerMixin< T, TDerived > &container) |
Insert a ContiguousContainerMixin into an output stream. | |