1#ifndef FIRE_IO_ABSTRACTDATA_H
2#define FIRE_IO_ABSTRACTDATA_H
6#include <boost/core/demangle.hpp>
8#include "fire/version/Version.h"
15namespace h5 {
class Reader; }
17namespace root {
class Reader; }
95template <
typename DataType>
116 DataType* handle =
nullptr);
226 virtual void update(
const DataType& val) {
Serialization class version deduction.
Type-specific base class to hold common data methods.
Definition: AbstractData.h:96
std::pair< std::string, int > save_type_
type this data that is being used to write
Definition: AbstractData.h:234
std::optional< std::pair< std::string, int > > load_type_
type this data is loading from
Definition: AbstractData.h:232
AbstractData(const std::string &path, Reader *input_file=nullptr, DataType *handle=nullptr)
Define the dataset path and provide an optional handle.
Definition: Data.h:38
virtual void clear()
Define the clear function here to handle the most common cases.
Definition: AbstractData.h:177
virtual void structure(Writer &f)=0
pure virtual method for saving structure
virtual void update(const DataType &val)
Update the in-memory data object with the passed value.
Definition: AbstractData.h:226
virtual void load(h5::Reader &f)=0
pure virtual method for loading data
virtual ~AbstractData()
Delete our object if we own it, otherwise do nothing.
Definition: AbstractData.h:124
int version() const
Get the version number for the type we are loading from.
Definition: AbstractData.h:205
virtual void save(Writer &f)=0
pure virtual method for saving data
bool owner_
we own the object in memory
Definition: AbstractData.h:239
virtual const DataType & get() const
Get the current in-memory data.
Definition: AbstractData.h:195
DataType * handle_
handle on current object in memory
Definition: AbstractData.h:237
Empty data base allowing recursion.
Definition: AbstractData.h:30
virtual void clear()=0
pure virtual method for resetting the current data to a blank state
virtual void load(h5::Reader &f)=0
pure virtual method for loading data from the input file
virtual void save(Writer &f)=0
pure virtual method for saving the current data
BaseData(const std::string &path)
Define the full in-file path to the data set of this data.
Definition: AbstractData.h:37
std::string path_
path of data set
Definition: AbstractData.h:82
virtual ~BaseData()=default
virtual destructor so inherited classes can be properly destructed.
virtual void structure(Writer &f)=0
we should persist our hierarchy into the output file
Prototype for reading files within fire.
Definition: Reader.h:29
Write the fire DataSets into a deterministic structure in the output HDF5 data file.
Definition: Writer.h:19
Reading a file generated by fire.
Definition: Reader.h:22
Reading ROOT files into our data structures.
Definition: Reader.h:29
Geant4 does a GLOBAL definition of the keyword TRUE.
Definition: AbstractData.h:11