EleFits  5.0.0
A modern C++ API on top of CFITSIO
Public Types | Static Public Attributes | Related Functions | List of all members
Column< T, N, TContainer > Class Template Reference

#include <Column.h>

Detailed Description

template<typename T, long N, typename TContainer>
class Euclid::Fits::Column< T, N, TContainer >

Binary table column data and metadata.

Template Parameters
TThe value type, possibly const-qualified for read-only columns
NThe entry dimension (number of axes) or -1 for runtime dimension
TContainerThe data container, which must meet SizedData requirements

A column is a contiguous container for the entry data of a binary table column. As explained in the ColumnInfo documentation (make sure to have read it before going further), entries can be made of several values. Template parameter N is bound to the entry category:

Template specialization PtrColumn
Column which points to some external data (TContainer = T*). More...
Template specialization VecColumn
Column which owns a data vector (TContainer = std::vector<T>). More...
Satisfies ContiguousContainer requirements
A contiguous container is a standard container whose elements are stored contiguously in memory.
Satisfies VectorArithmetic requirements
Implements vector space arithmetic operators (uppercase letters are for vectors, lowercase letters are for scalars):
  • Vector-additive: V += U, W = V + U, V += U, W = V - U;
  • Scalar-additive: V += a, V = U + a, V = a + U, V -= a, V = U + a, V = a - U;
  • Scalar-multiplicative: V *= a, V = U * a, V = a * U, V /= a, V = U / a;
  • Incrementation if enabled (for integral value types by default): V++, ++V, V–, –V.
See also
ColumnInfo for details on the entry properties.
makeColumn() for creation shortcuts.

Public Types

using Value = std::decay_t< T >
 The element value type.
 
using Info = ColumnInfo< Value, N >
 The info type.
 
- Public Types inherited from DataContainer< T, TContainer, Column< T, N, TContainer > >
using Holder = DataContainerHolder< T, TContainer >
 The concrete data holder type.
 
- Public Types inherited from ContiguousContainerMixin< T, TDerived >
using value_type = T
 The value type.
 
using reference = T &
 The value reference.
 
using const_reference = const T &
 The constant value reference.
 
using iterator = T *
 The value iterator.
 
using const_iterator = const T *
 The constant value iterator.
 
using difference_type = std::ptrdiff_t
 The iterator difference type.
 
using size_type = std::size_t
 The underlying container size type.
 

Static Public Attributes

static constexpr long Dim = N
 The dimension parameter.
 

Public Member Functions

Construction
 Column ()
 Default constructor.
 
 Column (Info info, long rowCount=0)
 Create an empty column with given metadata. More...
 
 Column (Info info, long rowCount, 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 Infoinfo () const
 Get the column metadata.
 
void rename (const std::string &name)
 Change the column name.
 
void reshape (long repeatCount=1)
 Change the column repeat count (fold/unfold). More...
 
void reshape (Position< N > shape)
 Change the entry shape. More...
 
long elementCount () const
 Number of elements in the column, i.e. repeat count times number of rows. More...
 
long rowCount () 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 > entry (long row) const
 Access the entry at given row as a raster.
 
PtrRaster< T, N > entry (long row)
 Access the entry at given row 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, TContainer, Column< T, N, TContainer > >
T * data ()
 Inherit data holder's data().
 
const T * data () const
 Inherit data holder's data().
 
const std::decay_t< TContainer > & container () const
 Access the container in read-only mode.
 
std::vector< T > vector () const
 Copy the container values into an std::vector. More...
 
TContainer & moveTo (TContainer &destination)
 Move the container. More...
 
std::size_t size () const
 Inherit data holder's size().
 
- Public Member Functions inherited from ContiguousContainerMixin< T, TDerived >
bool emtpy () 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 columnsRowCount (TSeq &&columns)
 The common number of rows of a sequence of columns. More...
 
template<typename TInfo , typename TContainer >
Column< typename TContainer::value_type, std::decay_t< TInfo >::Dim, TContainer > makeColumn (TInfo info, TContainer &&data)
 Shortcut to create a column from a column info and data without specifying the template parameters. More...
 
template<typename T , typename TInfo >
PtrColumn< T, std::decay_t< TInfo >::DimmakeColumn (TInfo &&info, long rowCount, T *data)
 Pointer specialization.
 

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