Wraps an archive around a memory buffer for output.
More...
#include <buffer_archive.h>
Wraps an archive around a memory buffer for output.
- Note
- Type checking is disabled for efficiency.
- Exceptions
-
The default constructor can also be used to count stuff.
◆ BufferOutputArchive() [1/2]
madness::archive::BufferOutputArchive::BufferOutputArchive |
( |
| ) |
|
|
inline |
Default constructor; the buffer will only count data.
◆ BufferOutputArchive() [2/2]
madness::archive::BufferOutputArchive::BufferOutputArchive |
( |
void * |
ptr, |
|
|
std::size_t |
nbyte |
|
) |
| |
|
inline |
Constructor that assigns a buffer.
- Parameters
-
[in] | ptr | Pointer to the buffer. |
[in] | nbyte | Size of the buffer. |
◆ close()
void madness::archive::BufferOutputArchive::close |
( |
| ) |
|
|
inline |
Close the archive.
Referenced by main().
◆ count_only()
bool madness::archive::BufferOutputArchive::count_only |
( |
| ) |
const |
|
inline |
Determine if this buffer is used for counting.
- Returns
- True if this buffer is only used for counting.
References countonly.
◆ flush()
void madness::archive::BufferOutputArchive::flush |
( |
| ) |
|
|
inline |
◆ open()
void madness::archive::BufferOutputArchive::open |
( |
std::size_t |
| ) |
|
|
inline |
Open a buffer with a specific size.
◆ size()
std::size_t madness::archive::BufferOutputArchive::size |
( |
| ) |
const |
|
inline |
◆ store()
Stores (counts) data into the memory buffer.
The function only appears (due to enable_if
) if T
is serializable.
- Template Parameters
-
T | Type of the data to be stored (counted). |
- Parameters
-
[in] | t | Pointer to the data to be stored (counted). |
[in] | n | Size of data to be stored (counted). |
References countonly, i, m, MADNESS_ASSERT, MADNESS_PRAGMA_GCC, nbyte, madness::nonlinear_vector_solver(), madness::pop(), madness::print(), ptr, and T().
◆ countonly
bool madness::archive::BufferOutputArchive::countonly |
|
private |
Current output location.
If true just count, don't copy.
Referenced by count_only(), and store().
std::size_t madness::archive::BufferOutputArchive::i |
|
mutableprivate |
◆ nbyte
const std::size_t madness::archive::BufferOutputArchive::nbyte |
|
private |
Buffer size.
Referenced by store().
◆ ptr
unsigned char* const madness::archive::BufferOutputArchive::ptr |
|
private |
The memory buffer.
Referenced by store().
The documentation for this class was generated from the following file: