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

#include <DataContainer.h>

Detailed Description

template<typename T, typename TContainer>
class Euclid::Fits::DataContainerHolder< T, TContainer >

A holder of any contiguous container specified by a size and data pointer.

The class can be specialized for any container, in which case it should satisfy the SizedData requirements.

Satisfies `SizedData` requirements
A contiguous data holder is some class which stores or points to some data contiguous in memory as a public or protected member TContainer m_container, and implements the following methods:
Example
Here is a minimal SizedData-compliant class which wraps a std::vector:
template<typename T>
struct MyData {
MyData(std::size_t s, T* d) : m_container(s) {
if (d) {
std::copy_n(d, s, m_container.begin());
}
}
std::size_t size() const {
return m_container.size();
}
inline const T* data() {
return m_container.data();
}
std::vector<T> m_container;
};
T copy_n(T... args)

Public Types

using Container = TContainer
 The concrete container type.
 

Public Member Functions

Construction
template<typename U >
 DataContainerHolder (std::size_t size, U *data)
 Default or size-based constructor.
 
template<typename... TArgs>
 DataContainerHolder (TArgs &&... args)
 Forwarding constructor.
 
Properties
std::size_t size () const
 Get the number of elements.
 
Element access
const T * data () const
 Access the raw data.
 

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