Jpp  18.2.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
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< JTransmitter > > JEEP::JContainer< std::vector< JTripod > > JDATABASE::JAHRSCalibration_t JDETECTOR::JPMTParametersMap JEEP::JContainer< JContainer_t > JOSCPROB::JOscParametersInterface< double > JOSCPROB::JOscParametersInterface< JGrid< double > > JOSCPROB::JOscParametersInterface< T >

Public Member Functions

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

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

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  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
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  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T

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