Binary table data unit containers and tools.
ColumnInfo
is the simple structure which stores the column metadata:
A Column
is an abstract class composed of a ColumnInfo
and some contiguous data. Analogously to Raster
, two specializations are provided, and others can be user-defined:
PtrColumn
is the lightest structure: it just knows a pointer to the first element of the column;VecColumn
owns the data as a std::vector
and is compatible with the move semantics.To write a column, any Column
implementation works: you can even provide your own, e.g. some EigenColumn
. Column
s are generally read as VecColumn
instances. If you want to give or steal the data to or from a VecColumn
, you can exploit move semantics, as shown in the Tutorial:
The following helpers are defined:
Segment
is just a pair of long
s used to specify a chunk of a Column
, e.g. for partial reading and writing of binary table HDUs;ColumnKey
is a minimal structure which basically means long
or std::string
and is responsible for backward indexing resolution;TypedKey
is a typed wrapper used to specify which column to read, as well as the desired return type; Maker function as()
is provided to simplify usage (see below).For example, to read several columns of different types, do:
instead of:
which would be error-prone when reading many columns.
Typedefs | |
template<typename T , long N = 1> | |
using | PtrColumn = Column< T, N, DataContainerHolder< T, T * > > |
Column which points to some external data (THolder = T* ). | |
template<typename T , long N = 1> | |
using | VecColumn = Column< T, N, DataContainerHolder< T, std::vector< T > > > |
Column which owns a data vector (THolder = std::vector<T> ). | |
Classes | |
class | Column< T, N, THolder > |
Binary table column data and metadata. More... | |
struct | ColumnInfo< T, N > |
Column informations, i.e. name, unit, field shape and value type. More... | |
struct | Segment |
Bounds of a closed index interval. More... | |
Macros | |
#define | ELEFITS_FOREACH_COLUMN_TYPE(MACRO) |
Loop over supported column types. More... | |