|
Simpatico
v1.10
|
Save archive for packed heterogeneous binary data.
Definition at line 31 of file MemoryOArchive.h.
#include <MemoryOArchive.h>
Public Member Functions | |
| MemoryOArchive () | |
| Constructor. More... | |
| virtual | ~MemoryOArchive () |
| Destructor. More... | |
| virtual void | allocate (size_t capacity) |
| Allocate memory. More... | |
| void | clear () |
| Resets the cursor to the beginning. More... | |
| template<typename T > | |
| void | operator& (T &data) |
| Save one object. More... | |
| template<typename T > | |
| MemoryOArchive & | operator<< (T &data) |
| Save one object. More... | |
| template<typename T > | |
| void | pack (const T &data) |
| Pack a T object. More... | |
| template<typename T > | |
| void | pack (const T *array, int n) |
| Pack a C array. More... | |
| template<typename T > | |
| void | pack (const T *array, int m, int n, int np) |
| Pack a 2D C array. More... | |
| void | send (MPI::Intracomm &comm, int dest) |
| Send packed data via MPI. More... | |
| void | iSend (MPI::Intracomm &comm, MPI::Request &req, int dest) |
| Send packed data via MPI (non-blocking) More... | |
| Byte * | begin () const |
| Return pointer to beginning of block. More... | |
| Byte * | cursor () const |
| Return pointer to current position (cursor). More... | |
| size_t | capacity () const |
| Return capacity in Bytes. More... | |
| bool | isAllocated () const |
| Has memory been allocated? More... | |
Static Public Member Functions | |
| static bool | is_saving () |
| Returns true;. More... | |
| static bool | is_loading () |
| Returns false;. More... | |
| Util::MemoryOArchive::MemoryOArchive | ( | ) |
Constructor.
Definition at line 19 of file MemoryOArchive.cpp.
|
virtual |
Destructor.
Definition at line 33 of file MemoryOArchive.cpp.
|
inlinestatic |
Returns true;.
Definition at line 188 of file MemoryOArchive.h.
|
inlinestatic |
Returns false;.
Definition at line 191 of file MemoryOArchive.h.
|
virtual |
Allocate memory.
| capacity | size of memory block in bytes |
Definition at line 44 of file MemoryOArchive.cpp.
References begin(), capacity(), and UTIL_THROW.
Referenced by McMd::ReplicaMove::move().
| void Util::MemoryOArchive::clear | ( | ) |
Resets the cursor to the beginning.
Definition at line 62 of file MemoryOArchive.cpp.
References begin(), isAllocated(), and UTIL_THROW.
|
inline |
|
inline |
|
inline |
Pack a T object.
Definition at line 243 of file MemoryOArchive.h.
References UTIL_THROW.
Referenced by pack().
|
inline |
Pack a C array.
| array | C array |
| n | number of elements |
Definition at line 261 of file MemoryOArchive.h.
References UTIL_THROW.
|
inline |
Pack a 2D C array.
Pack m rows of n elements from array of type T array[mp][np], with n <= np and m <= mp.
| array | poiner to [0][0] element of 2D array |
| m | logical number of rows |
| n | logical number of columns |
| np | physical number of columns |
Definition at line 281 of file MemoryOArchive.h.
References pack(), Util::serialize(), and UTIL_THROW.
| void Util::MemoryOArchive::send | ( | MPI::Intracomm & | comm, |
| int | dest | ||
| ) |
Send packed data via MPI.
| comm | MPI communicator |
| dest | rank of processor to which data is sent |
Definition at line 74 of file MemoryOArchive.cpp.
References UTIL_THROW.
Referenced by McMd::ReplicaMove::move().
| void Util::MemoryOArchive::iSend | ( | MPI::Intracomm & | comm, |
| MPI::Request & | req, | ||
| int | dest | ||
| ) |
Send packed data via MPI (non-blocking)
| comm | MPI communicator |
| req | MPI request |
| dest | rank of processor to which data is sent |
Definition at line 97 of file MemoryOArchive.cpp.
References UTIL_THROW.
|
inline |
Return pointer to beginning of block.
Definition at line 211 of file MemoryOArchive.h.
Referenced by allocate(), and clear().
|
inline |
Return pointer to current position (cursor).
Definition at line 217 of file MemoryOArchive.h.
|
inline |
Return capacity in Bytes.
Definition at line 205 of file MemoryOArchive.h.
Referenced by allocate().
|
inline |
1.8.11