3 #include <boost/core/demangle.hpp>
45 virtual void load() = 0;
86 template <
typename DataType>
107 DataType* handle =
nullptr)
115 save_type_ = {boost::core::demangle(
typeid(DataType).name()),
116 class_version<DataType>};
173 if constexpr (std::numeric_limits<DataType>::is_specialized) {
174 *(this->
handle_) = std::numeric_limits<DataType>::min();
Serialization class version deduction.
Type-specific base class to hold common data methods.
Definition: AbstractBranch.h:87
virtual const DataType & get() const
Get the current in-memory data.
Definition: AbstractBranch.h:189
virtual void load()=0
pure virtual method for loading data
virtual ~AbstractBranch()
Delete our object if we own it, otherwise do nothing.
Definition: AbstractBranch.h:125
int version() const
Get the version number for the type we are loading from.
Definition: AbstractBranch.h:199
AbstractBranch(const std::string &branch_name, DataType *handle=nullptr)
Define the dataset branch_name and provide an optional handle.
Definition: AbstractBranch.h:106
std::pair< std::string, int > save_type_
type this data that is being used to write
Definition: AbstractBranch.h:244
std::optional< std::pair< std::string, int > > load_type_
type this data is loading from
Definition: AbstractBranch.h:242
virtual void update(const DataType &val)
Update the in-memory data object with the passed value.
Definition: AbstractBranch.h:218
const DataType * operator->() const
Pointer access to the in-memory data type in a const manner.
Definition: AbstractBranch.h:238
DataType & operator*()
Access the in-memory data object.
Definition: AbstractBranch.h:223
virtual void attach(Writer &f)=0
pure virtual method for saving structure
DataType * operator->()
Pointer access to the in-memory data type.
Definition: AbstractBranch.h:233
bool owner_
we own the object in memory
Definition: AbstractBranch.h:249
virtual void clear()
Define the clear function here to handle the most common cases.
Definition: AbstractBranch.h:171
virtual void attach(Reader &f)=0
pure virtual method for loading data from the input file
const DataType & operator*() const
Access the in-memory data opbject in a const manner.
Definition: AbstractBranch.h:228
virtual void save()=0
pure virtual method for saving data
DataType * handle_
handle on current object in memory
Definition: AbstractBranch.h:247
Empty data base allowing recursion.
Definition: AbstractBranch.h:26
virtual void save()=0
pure virtual method for saving the current data
virtual void clear()=0
pure virtual method for resetting the current data to a blank state
virtual void attach(Reader &f)=0
pure virtual method for loading data from the input file
std::string name_
name of branch
Definition: AbstractBranch.h:74
virtual void attach(Writer &f)=0
we should persist our hierarchy into the output file
BaseBranch(const BaseBranch &)=delete
no copying
BaseBranch & operator=(const BaseBranch &)=delete
no copying
BaseBranch(const std::string &full_name)
define the full name of the branch
Definition: AbstractBranch.h:31
virtual ~BaseBranch()=default
virtual destructor so inherited classes can be properly destructed.
Reading a file generated by fire.
Definition: Reader.h:24
Write the fire DataSets into a deterministic structure in the output HDF5 data file.
Definition: Writer.h:21
Geant4 does a GLOBAL definition of the keyword TRUE.
Definition: Atomic.cxx:3