Jpp  18.0.0-rc.3
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
JIO::JObjectBinaryIO< T > Struct Template Reference

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

#include <JObjectBinaryIO.hh>

Inheritance diagram for JIO::JObjectBinaryIO< T >:
JPHYSICS::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPHYSICS::JPDFTable< JFunction1D_t, JPDFMapList_t > JPHYSICS::JCDFTable< JFunction1D_t, JMaplist_t, JDistance_t > JPHYSICS::JPDFTable< JFunction1D_t, JMaplist_t, JDistance_t > JTOOLS::JMultiPDF< JFunction_t, JMaplist_t, JDistance_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 JIO::JObjectBinaryIO< T >

Auxiliary base class for storing and loading a single object to and from a binary 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 23 of file JObjectBinaryIO.hh.

Member Function Documentation

template<class T>
void JIO::JObjectBinaryIO< T >::load ( const char *  file_name)
inline

Load from input file.

Parameters
file_namefile name

Definition at line 29 of file JObjectBinaryIO.hh.

30  {
31  JLANG::load<JFileStreamReader>(file_name, static_cast<T&>(*this));
32  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
template<class T>
void JIO::JObjectBinaryIO< T >::store ( const char *  file_name) const
inline

Store to output file.

Parameters
file_namefile name

Definition at line 40 of file JObjectBinaryIO.hh.

41  {
42  JLANG::store<JFileStreamWriter>(file_name, static_cast<const T&>(*this));
43  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T

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