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_t > buffer
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 226 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 230 of file Writer.h.

231 :
232 buffer() {
233 hsize_t offset = 0;
234 for (const auto& arg: args) {
235 const size_t this_dim_max = extent.at(extent.size() - N);
236 if (offset >= this_dim_max) return;
237 DataFlattener<N-1, F, decltype(arg), M> in(filler, arg, extent);
238 buffer.insert(buffer.end(), in.buffer.begin(), in.buffer.end());
239 for (const auto& in_ele: in.element_offsets){
241 element_pos.at(0) = offset;
242 std::copy(in_ele.begin(), in_ele.end(), element_pos.begin() + 1);
243 element_offsets.push_back(element_pos);
244 }
245 offset++;
246 }
247 }
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:226
DataFlattener(const F &filler, T args, const std::array< hsize_t, M > &extent)
Definition Writer.h:230
std::vector< data_buffer_t > buffer
Definition Writer.h:228
std::vector< std::array< hsize_t, N > > element_offsets
Definition Writer.h:229

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 228 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 229 of file Writer.h.


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