EleFits  5.0.0
A modern C++ API on top of CFITSIO
Public Types | List of all members
DataContainer< T, TContainer, TDerived > Class Template Reference

#include <DataContainer.h>

Detailed Description

template<typename T, typename TContainer, typename TDerived>
class Euclid::Fits::DataContainer< T, TContainer, TDerived >

Mix ContiguousContainerMixin and VectorArithmeticMixin into a DataHolder as a user-defined derived class.

Template Parameters
TDerivedThe derived class

The class can be specialized for any container which implements the SizedData requirements.

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.

Public Types

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.
 

Public Member Functions

Element access
T * data ()
 Inherit data holder's data().
 
const std::decay_t< TContainer > & container () const
 Access the container in read-only mode.
 
const T * data () const
 Inherit data holder's data().
 
Operations
std::vector< T > vector () const
 Copy the container values into an std::vector. More...
 
Data modifiers
TContainer & moveTo (TContainer &destination)
 Move the container. More...
 
Properties
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.
 

Additional Inherited Members


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