Wraps an archive around a memory buffer for input.
More...
#include <buffer_archive.h>
|
std::size_t | i |
| Current input location.
|
|
const std::size_t | nbyte |
| Buffer size.
|
|
const unsigned char *const | ptr |
| The memory buffer.
|
|
|
using | is_loading = std::true_type |
| Type used by Boost.Serialization to determine if this object is an input archive.
|
|
using | is_loading = std::false_type |
| Type used by Boost.Serialization to determine if this object is an input archive.
|
|
using | is_saving = std::false_type |
| Type used by Boost.Serialization to determine if this object is an output archive.
|
|
static constexpr bool | is_input_archive = true |
| Flag to determine if this object is an input archive.
|
|
static constexpr bool | is_archive = true |
| Flag to determine if this object is an archive.
|
|
static constexpr bool | is_input_archive = false |
| Flag to determine if this object is an input archive.
|
|
static constexpr bool | is_output_archive = false |
| Flag to determine if this object is an output archive.
|
|
static constexpr bool | is_parallel_archive = false |
| Flag to determine if this object is a parallel archive.
|
|
Wraps an archive around a memory buffer for input.
- Note
- Type checking is disabled for efficiency.
- Exceptions
-
◆ BufferInputArchive()
madness::archive::BufferInputArchive::BufferInputArchive |
( |
const 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::BufferInputArchive::close |
( |
| ) |
|
|
inline |
Close the archive.
Referenced by main().
◆ load()
Reads data from the memory buffer.
The function only appears (due to enable_if
) if T
is serializable.
- Template Parameters
-
T | Type of the data to be read. |
- Parameters
-
[out] | t | Where to store the read data. |
[in] | n | Size of data to be read. |
References i, m, MADNESS_ASSERT, nbyte, ptr, and T().
Referenced by test0().
◆ nbyte_avail()
std::size_t madness::archive::BufferInputArchive::nbyte_avail |
( |
| ) |
const |
|
inline |
Get the amount of space yet to be read from the buffer.
- Returns
- The amount of space yet to be read from the buffer.
References i, and nbyte.
◆ open()
void madness::archive::BufferInputArchive::open |
( |
| ) |
|
|
inline |
◆ rewind()
void madness::archive::BufferInputArchive::rewind |
( |
| ) |
const |
|
inline |
Reset the read location to the beginning of the buffer.
References i.
std::size_t madness::archive::BufferInputArchive::i |
|
mutableprivate |
◆ nbyte
const std::size_t madness::archive::BufferInputArchive::nbyte |
|
private |
◆ ptr
const unsigned char* const madness::archive::BufferInputArchive::ptr |
|
private |
The memory buffer.
Referenced by load().
The documentation for this class was generated from the following file: