|
PSCF v1.3.3
|
Saving archive for character based ostream. More...
#include <TextFileOArchive.h>
Public Member Functions | |
| TextFileOArchive () | |
| Constructor. | |
| TextFileOArchive (std::string filename) | |
| Constructor. | |
| TextFileOArchive (std::ofstream &file) | |
| Constructor. | |
| virtual | ~TextFileOArchive () |
| Destructor. | |
| std::ofstream & | file () |
| Get the underlying ifstream by reference. | |
| template<typename T> | |
| TextFileOArchive & | operator<< (T &data) |
| Save one T object to this archive via the << (insertion) operator. | |
| template<typename T> | |
| TextFileOArchive & | operator& (T &data) |
| Save one T object to this archive. | |
| template<typename T, size_t N> | |
| TextFileOArchive & | operator<< (T(&data)[N]) |
| Save a fixed size array via operator <<. | |
| template<typename T, size_t N> | |
| TextFileOArchive & | operator& (T(&data)[N]) |
| Save a fixed size array via operator &. | |
| template<typename T> | |
| void | pack (const T &data) |
| Save one T object to this archive. | |
| template<typename T> | |
| void | pack (const T *array, int n) |
| Save a C-array of T objects to this archive. | |
| template<typename T> | |
| void | pack (const T *array, int m, int n, int np) |
| Save a 2D C array to this archive. | |
Static Public Member Functions | |
| static bool | is_saving () |
| Returns true;. | |
| static bool | is_loading () |
| Returns false;. | |
Saving archive for character based ostream.
Definition at line 30 of file TextFileOArchive.h.
| Util::TextFileOArchive::TextFileOArchive | ( | ) |
Constructor.
Definition at line 16 of file TextFileOArchive.cpp.
Referenced by operator&(), operator&(), operator<<(), and operator<<().
| Util::TextFileOArchive::TextFileOArchive | ( | std::string | filename | ) |
Constructor.
| filename | name of file to open for reading. |
Definition at line 25 of file TextFileOArchive.cpp.
| Util::TextFileOArchive::TextFileOArchive | ( | std::ofstream & | file | ) |
Constructor.
| file | output file |
Definition at line 35 of file TextFileOArchive.cpp.
References file().
|
virtual |
Destructor.
Definition at line 48 of file TextFileOArchive.cpp.
|
inlinestatic |
Returns true;.
Definition at line 157 of file TextFileOArchive.h.
|
inlinestatic |
Returns false;.
Definition at line 160 of file TextFileOArchive.h.
| std::ofstream & Util::TextFileOArchive::file | ( | ) |
Get the underlying ifstream by reference.
Definition at line 58 of file TextFileOArchive.cpp.
Referenced by TextFileOArchive().
|
inline |
Save one T object to this archive via the << (insertion) operator.
Implementation calls a global serialize function.
| data | object to be saved to archive |
Definition at line 169 of file TextFileOArchive.h.
References TextFileOArchive().
|
inline |
Save one T object to this archive.
Equivalent to operator <<.
| data | object to be saved to archive |
Definition at line 179 of file TextFileOArchive.h.
References TextFileOArchive().
|
inline |
Save a fixed size array via operator <<.
Implementation applies the serialize function to each element. The 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 189 of file TextFileOArchive.h.
References TextFileOArchive().
|
inline |
Save a fixed size array via operator &.
Equivalent to << operator.
| data | array of fixed size N with elements of type T |
Definition at line 201 of file TextFileOArchive.h.
References TextFileOArchive().
|
inline |
Save one T object to this archive.
| data | object to be written to file |
Definition at line 215 of file TextFileOArchive.h.
|
inline |
Save a C-array of T objects to this archive.
| array | C array of T objects (pointer to first element) |
| n | number of elements |
Definition at line 234 of file TextFileOArchive.h.
|
inline |
Save a 2D C array to this archive.
| array | address of first element array[0][0] of 2D array |
| m | logical number of rows |
| n | logical number of columns |
| np | physical number of columns |
Definition at line 246 of file TextFileOArchive.h.