PSCF v1.2
|
Loading (input) archive for binary istream. More...
#include <BinaryFileIArchive.h>
Public Member Functions | |
BinaryFileIArchive () | |
Constructor. | |
BinaryFileIArchive (std::string filename) | |
Constructor. | |
BinaryFileIArchive (std::ifstream &file) | |
Constructor. | |
virtual | ~BinaryFileIArchive () |
Destructor. | |
std::ifstream & | file () |
Get the underlying ifstream by reference. | |
template<typename T > | |
BinaryFileIArchive & | operator>> (T &data) |
Load (read) one object of type T via the & operator. | |
template<typename T > | |
BinaryFileIArchive & | operator& (T &data) |
Load (read) one object of type T via the & operator. | |
template<typename T , size_t N> | |
BinaryFileIArchive & | operator>> (T(&data)[N]) |
Load a fixed size array via operator >>. | |
template<typename T , size_t N> | |
BinaryFileIArchive & | operator& (T(&data)[N]) |
Load a fixed size array via operator &. | |
template<typename T > | |
void | unpack (T &data) |
Unpack a single T object. | |
template<typename T > | |
void | unpack (T *array, int n) |
Unpack a C array. | |
template<typename T > | |
void | unpack (T *array, int m, int n, int np) |
Unpack a 2D C array. | |
Static Public Member Functions | |
static bool | is_saving () |
Is this a saving (output) archive? Returns false. | |
static bool | is_loading () |
Is this a loading (input) archive? Returns true. | |
Loading (input) archive for binary istream.
Definition at line 30 of file BinaryFileIArchive.h.
Util::BinaryFileIArchive::BinaryFileIArchive | ( | ) |
Constructor.
Definition at line 18 of file BinaryFileIArchive.cpp.
Util::BinaryFileIArchive::BinaryFileIArchive | ( | std::string | filename | ) |
Constructor.
filename | name of file to open for reading. |
Definition at line 27 of file BinaryFileIArchive.cpp.
Util::BinaryFileIArchive::BinaryFileIArchive | ( | std::ifstream & | file | ) |
|
virtual |
Destructor.
Definition at line 45 of file BinaryFileIArchive.cpp.
|
inlinestatic |
Is this a saving (output) archive? Returns false.
Definition at line 161 of file BinaryFileIArchive.h.
|
inlinestatic |
Is this a loading (input) archive? Returns true.
Definition at line 164 of file BinaryFileIArchive.h.
std::ifstream & Util::BinaryFileIArchive::file | ( | ) |
Get the underlying ifstream by reference.
Definition at line 55 of file BinaryFileIArchive.cpp.
|
inline |
Load (read) one object of type T via the & operator.
data | object of type T to be loaded from archive |
Definition at line 173 of file BinaryFileIArchive.h.
|
inline |
Load (read) one object of type T via the & operator.
Equivalent to the >> operator.
data | object of type T to be loaded from archive |
Definition at line 183 of file BinaryFileIArchive.h.
|
inline |
Load 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 BinaryFileIArchive.h.
|
inline |
Load 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 207 of file BinaryFileIArchive.h.
|
inline |
Unpack a single T object.
Definition at line 221 of file BinaryFileIArchive.h.
Referenced by Util::CArray2DParam< Type >::loadValue(), and Util::CArrayParam< Type >::loadValue().
|
inline |
Unpack a C array.
array | pointer to array (or first element) |
n | number of elements |
Definition at line 228 of file BinaryFileIArchive.h.
|
inline |
Unpack a 2D C array.
This unpacks the elements of an m x n logical array into a physical 2D C array of type array[][np], where np is the physical length of a row, i.e., the amount of memory allocated per row.
array | pointer to first row |
m | number of rows |
n | logical number of columns |
np | physical number of columns |
Definition at line 239 of file BinaryFileIArchive.h.