|
PSCF v1.3.3
|
Saving / output archive for binary ostream. More...
#include <BinaryFileOArchive.h>
Public Member Functions | |
| BinaryFileOArchive () | |
| Constructor. | |
| BinaryFileOArchive (std::string filename) | |
| Constructor. | |
| BinaryFileOArchive (std::ofstream &file) | |
| Constructor. | |
| virtual | ~BinaryFileOArchive () |
| Destructor. | |
| std::ofstream & | file () |
| Get the underlying ifstream by reference. | |
| template<typename T> | |
| BinaryFileOArchive & | operator<< (T &data) |
| Save (write) one object of type T via the << operator. | |
| template<typename T> | |
| BinaryFileOArchive & | operator& (T &data) |
| Save (write) one object of type T via the & operator. | |
| template<typename T, size_t N> | |
| BinaryFileOArchive & | operator<< (T(&data)[N]) |
| Save a fixed size array via operator <<. | |
| template<typename T, size_t N> | |
| BinaryFileOArchive & | operator& (T(&data)[N]) |
| Save a fixed size array via operator &. | |
| template<typename T> | |
| void | pack (const T &data) |
| Pack one object of type T. | |
| template<typename T> | |
| void | pack (const T *array, int n) |
| Pack a C array. | |
| template<typename T> | |
| void | pack (const T *array, int m, int n, int np) |
| Pack a 2D C array. | |
Static Public Member Functions | |
| static bool | is_saving () |
| Returns true;. | |
| static bool | is_loading () |
| Returns false;. | |
Saving / output archive for binary ostream.
Definition at line 30 of file BinaryFileOArchive.h.
| Util::BinaryFileOArchive::BinaryFileOArchive | ( | ) |
Constructor.
Definition at line 16 of file BinaryFileOArchive.cpp.
Referenced by operator&(), operator&(), operator<<(), and operator<<().
| Util::BinaryFileOArchive::BinaryFileOArchive | ( | std::string | filename | ) |
Constructor.
| filename | name of file to open for reading. |
Definition at line 25 of file BinaryFileOArchive.cpp.
| Util::BinaryFileOArchive::BinaryFileOArchive | ( | std::ofstream & | file | ) |
Constructor.
| file | output file |
Definition at line 34 of file BinaryFileOArchive.cpp.
References file().
|
virtual |
Destructor.
Definition at line 43 of file BinaryFileOArchive.cpp.
|
inlinestatic |
Returns true;.
Definition at line 162 of file BinaryFileOArchive.h.
|
inlinestatic |
Returns false;.
Definition at line 165 of file BinaryFileOArchive.h.
| std::ofstream & Util::BinaryFileOArchive::file | ( | ) |
Get the underlying ifstream by reference.
Definition at line 53 of file BinaryFileOArchive.cpp.
Referenced by BinaryFileOArchive().
|
inline |
Save (write) one object of type T via the << operator.
The implementation calls the appropriate global serialize function.
| data | object of type T to be saved to this archive |
Definition at line 174 of file BinaryFileOArchive.h.
References BinaryFileOArchive().
|
inline |
Save (write) one object of type T via the & operator.
Equivalent to corresponding << operator.
| data | object of type T to be saved to this archive |
Definition at line 184 of file BinaryFileOArchive.h.
References BinaryFileOArchive().
|
inline |
Save a fixed size array via operator <<.
The implementation applies the serialize function to each element. This template should thus work for any type T for which a serialize function exists.
| data | array of fixed size N with elements of type T |
Definition at line 194 of file BinaryFileOArchive.h.
References BinaryFileOArchive().
|
inline |
Save a fixed size array via operator &.
Equivalent to the corresponding << operator.
| data | array of fixed size N with elements of type T |
Definition at line 206 of file BinaryFileOArchive.h.
References BinaryFileOArchive().
|
inline |
Pack one object of type T.
| data | object of type T to be saved to this archive |
Definition at line 220 of file BinaryFileOArchive.h.
Referenced by Util::Parameter::saveOptionalCArray(), Util::Parameter::saveOptionalCArray2D(), Util::CArray2DParam< Type >::saveValue(), and Util::CArrayParam< Type >::saveValue().
|
inline |
Pack a C array.
| array | address of first element |
| n | number of elements |
Definition at line 227 of file BinaryFileOArchive.h.
|
inline |
Pack a 2D C array.
This packs m rows of length n within a 2D C array allocated as array[][np], where np is the physical length of one row.
| array | pointer to [0][0] element in 2D array |
| m | number of rows |
| n | logical number of columns |
| np | physical number of columns |
Definition at line 238 of file BinaryFileOArchive.h.