ATLAS Offline Software
Loading...
Searching...
No Matches
H5Utils::internal::DataFlattener< N, F, T, M > Struct Template Reference

Data flattener class: this is used by the writer to read in the elements one by one and put them in an internal buffer. More...

#include <Writer.h>

Collaboration diagram for H5Utils::internal::DataFlattener< N, F, T, M >:

Public Member Functions

 DataFlattener (const F &filler, T args, const std::array< hsize_t, M > &extent)

Public Attributes

std::vector< data_buffer_tbuffer
std::vector< std::array< hsize_t, N > > element_offsets

Detailed Description

template<size_t N, typename F, typename T, size_t M = N>
struct H5Utils::internal::DataFlattener< N, F, T, M >

Data flattener class: this is used by the writer to read in the elements one by one and put them in an internal buffer.

We use a struct rather than a full blown class. Like all things in the internal namespace, you should not mess with this unless you really know what you are doing.

Definition at line 224 of file Writer.h.

Constructor & Destructor Documentation

◆ DataFlattener()

template<size_t N, typename F, typename T, size_t M = N>
H5Utils::internal::DataFlattener< N, F, T, M >::DataFlattener ( const F & filler,
T args,
const std::array< hsize_t, M > & extent )
inline

Definition at line 228 of file Writer.h.

229 :
230 buffer() {
231 hsize_t offset = 0;
232 for (const auto& arg: args) {
233 const size_t this_dim_max = extent.at(extent.size() - N);
234 if (offset >= this_dim_max) return;
235 DataFlattener<N-1, F, decltype(arg), M> in(filler, arg, extent);
236 buffer.insert(buffer.end(), in.buffer.begin(), in.buffer.end());
237 for (const auto& in_ele: in.element_offsets){
239 element_pos.at(0) = offset;
240 std::copy(in_ele.begin(), in_ele.end(), element_pos.begin() + 1);
241 element_offsets.push_back(element_pos);
242 }
243 offset++;
244 }
245 }
Data flattener class: this is used by the writer to read in the elements one by one and put them in a...
Definition Writer.h:224
DataFlattener(const F &filler, T args, const std::array< hsize_t, M > &extent)
Definition Writer.h:228
std::vector< data_buffer_t > buffer
Definition Writer.h:226
std::vector< std::array< hsize_t, N > > element_offsets
Definition Writer.h:227

Member Data Documentation

◆ buffer

template<size_t N, typename F, typename T, size_t M = N>
std::vector<data_buffer_t> H5Utils::internal::DataFlattener< N, F, T, M >::buffer

Definition at line 226 of file Writer.h.

◆ element_offsets

template<size_t N, typename F, typename T, size_t M = N>
std::vector<std::array<hsize_t, N> > H5Utils::internal::DataFlattener< N, F, T, M >::element_offsets

Definition at line 227 of file Writer.h.


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