Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JObjectStreamIO< T > Struct Template Reference

Auxiliary base class for storing and loading a single object to and from an ASCII file, respectively. More...

#include <JObjectStreamIO.hh>

Inheritance diagram for JLANG::JObjectStreamIO< T >:
JEEP::JContainer< std::vector< JTripod > > JEEP::JContainer< std::vector< JTransmitter > > JAANET::JHondaFluxInterpolator< JPhiFunction_t, JCoszFunctionalMap_t, JEnergyFunctionalMap_t > JAANET::JHondaFluxInterpolator< JConstantFunction1D< double, JArray< 4, double > >, JCoszFunctionalMap_t, JEnergyFunctionalMap_t > JDATABASE::JAHRSCalibration_t JDETECTOR::JPMTParametersMap JEEP::JContainer< JContainer_t > JOSCPROB::JOscParameters< T >

Public Member Functions

void load (const char *file_name)
 Load from input file.
 
void store (const char *file_name) const
 Store to output file.
 

Detailed Description

template<class T>
struct JLANG::JObjectStreamIO< T >

Auxiliary base class for storing and loading a single object to and from an ASCII file, respectively.

The implementation of this functionality is based on a static cast of the given template parameter (known as "curiously recurring template pattern").

Definition at line 24 of file JObjectStreamIO.hh.

Member Function Documentation

◆ load()

template<class T >
void JLANG::JObjectStreamIO< T >::load ( const char * file_name)
inline

Load from input file.

Parameters
file_namefile name

Definition at line 30 of file JObjectStreamIO.hh.

31 {
32 JLANG::load<std::ifstream>(file_name, static_cast<T&>(*this));
33 }
void load(const std::string &file_name, T &object)
Load object from input file.
Definition JObjectIO.hh:55

◆ store()

template<class T >
void JLANG::JObjectStreamIO< T >::store ( const char * file_name) const
inline

Store to output file.

Parameters
file_namefile name

Definition at line 41 of file JObjectStreamIO.hh.

42 {
43 JLANG::store<std::ofstream>(file_name, static_cast<const T&>(*this));
44 }
void store(const std::string &file_name, const T &object)
Store object to output file.
Definition JObjectIO.hh:68

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