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

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

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


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