Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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 > JOSCPROB::JOscProbInterpolator< JCollection_t, JFunction1D_t, JFunctionalMaplist_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.
 
void store (const char *file_name) const
 Store to output file.
 

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

◆ load()

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 }
void load(const std::string &file_name, T &object)
Load object from input file.
Definition JObjectIO.hh:55

◆ store()

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 }
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: