31#ifndef CLASSIC_FIELDARRAY_H
32#define CLASSIC_FIELDARRAY_H
77 bool tryMap(
const std::string& filename,
78 const std::string& dataset,
79 std::size_t expectedSamples,
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
bool tryMap(const std::string &filename, const std::string &dataset, std::size_t expectedSamples, std::string &why)
double operator[](std::size_t i) const
const double * data_m
what operator[] reads; into owned_m or the mapping
std::size_t size() const
Number of samples. Zero for an array that has not been filled.
std::vector< double > owned_m
used when not mapped
const double * data() const
void allocate(std::size_t n)
FieldArray(const FieldArray &)=delete
std::size_t mapBytes_m
length passed to mmap, for munmap
FieldArray & operator=(const FieldArray &)=delete
void reset()
Release the buffer or the mapping.
bool anyNonZero(std::size_t begin, std::size_t end) const
std::size_t size_m
samples, not bytes
void * mapping_m
page-aligned mmap base, null when not mapped