EleFits  5.3.1
A modern C++ API on top of CFITSIO
Loading...
Searching...
No Matches
Public Types | List of all members
DataContainer< T, THolder, TDerived > Class Template Reference

#include <DataContainer.h>

Detailed Description

template<typename T, typename THolder, typename TDerived>
class Euclid::Fits::DataContainer< T, THolder, 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 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.
 

Public Member Functions

Construction
template<typename TSize = std::size_t, typename std::enable_if_t< std::is_integral< TSize >::value, TSize > * = nullptr>
 DataContainer (TSize s=0, std::remove_const_t< T > *d=nullptr)
 Construct from a size and non-constant data.
 
template<typename TSize = std::size_t, typename std::enable_if_t< std::is_integral< TSize >::value, TSize > * = nullptr>
 DataContainer (TSize s, const T *d)
 Construct from a size and constant data.
 
template<typename TIterator >
 DataContainer (TIterator begin, TIterator end)
 Iterator-based constructor.
 
 DataContainer (std::initializer_list< T > values)
 Value list constructor.
 
template<typename TArg0 , typename... TArgs, typename std::enable_if_t< not std::is_integral< TArg0 >::value, TArg0 > * = nullptr>
 DataContainer (TArg0 arg0, TArgs &&... args)
 Forwarding constructor.
 
Element access
T * data ()
 
const std::decay_t< Container > & container () const
 Access the container in read-only mode.
 
Data modifiers
ContainermoveTo (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.
 

Additional Inherited Members


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