Wraps an archive around a binary filestream for input.
More...
#include <binary_fstream_archive.h>
|
using | is_loading = std::true_type |
| Type used by Boost.Serialization to determine if this object is an input archive. More...
|
|
using | is_loading = std::false_type |
| Type used by Boost.Serialization to determine if this object is an input archive. More...
|
|
using | is_saving = std::false_type |
| Type used by Boost.Serialization to determine if this object is an output archive. More...
|
|
static constexpr bool | is_input_archive = true |
| Flag to determine if this object is an input archive. More...
|
|
static constexpr bool | is_archive = true |
| Flag to determine if this object is an archive. More...
|
|
static constexpr bool | is_input_archive = false |
| Flag to determine if this object is an input archive. More...
|
|
static constexpr bool | is_output_archive = false |
| Flag to determine if this object is an output archive. More...
|
|
static constexpr bool | is_parallel_archive = false |
| Flag to determine if this object is a parallel archive. More...
|
|
Wraps an archive around a binary filestream for input.
◆ BinaryFstreamInputArchive() [1/2]
madness::archive::BinaryFstreamInputArchive::BinaryFstreamInputArchive |
( |
const char * |
filename = nullptr , |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::in |
|
) |
| |
Default constructor.
The filename and open modes are optional here; they can be specified later by calling open()
.
- Parameters
-
[in] | filename | Name of the file to read from. |
[in] | mode | I/O attributes for opening the file. |
References madness::filename, and open().
◆ BinaryFstreamInputArchive() [2/2]
madness::archive::BinaryFstreamInputArchive::BinaryFstreamInputArchive |
( |
const std::string |
name, |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::in |
|
) |
| |
|
inline |
Default constructor.
The filename and open modes are optional here; they can be specified later by calling open()
.
- Parameters
-
[in] | filename | Name of the file to read from. |
[in] | mode | I/O attributes for opening the file. |
◆ close()
void madness::archive::BinaryFstreamInputArchive::close |
( |
| ) |
|
Close the filestream.
References iobuf, and is.
Referenced by main().
◆ load()
Load from the filestream.
The function only appears (due to enable_if
) if T
is serializable.
- Template Parameters
-
T | The type of data to be read. |
- Parameters
-
[out] | t | Where to put the loaded data. |
[in] | n | The number of data items to be loaded. |
References is, and T().
Referenced by open().
◆ open()
void madness::archive::BinaryFstreamInputArchive::open |
( |
const char * |
filename, |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::in |
|
) |
| |
◆ iobuf
std::shared_ptr<char> madness::archive::BinaryFstreamInputArchive::iobuf |
|
private |
◆ IOBUFSIZE
const std::size_t madness::archive::BinaryFstreamInputArchive::IOBUFSIZE = 4*1024*1024 |
|
staticprivate |
Buffer size.
Referenced by open().
◆ is
std::ifstream madness::archive::BinaryFstreamInputArchive::is |
|
mutableprivate |
The documentation for this class was generated from the following files: