Wraps an archive around a binary filestream for output.
More...
#include <binary_fstream_archive.h>
|
| | BinaryFstreamOutputArchive (const char *filename=nullptr, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc) |
| | Default constructor.
|
| |
| | BinaryFstreamOutputArchive (const std::string name, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc) |
| |
| void | close () |
| | Close the filestream.
|
| |
| void | flush () |
| | Flush the filestream.
|
| |
| void | open (const char *filename, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc) |
| | Open the filestream.
|
| |
| template<class T > |
| std::enable_if< is_trivially_serializable< T >::value, void >::type | store (const T *t, long n) const |
| | Write to the filestream.
|
| |
| | BaseArchive () |
| |
|
| std::shared_ptr< char > | iobuf |
| | Buffer.
|
| |
| std::ofstream | os |
| | The filestream.
|
| |
|
| static const std::size_t | IOBUFSIZE = 4*1024*1024 |
| | Buffer size.
|
| |
|
| using | is_saving = std::true_type |
| | Type used by Boost.Serialization to determine if this object is an output 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_output_archive = true |
| | Flag to determine if this object is an output 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 binary filestream for output.
◆ BinaryFstreamOutputArchive() [1/2]
| madness::archive::BinaryFstreamOutputArchive::BinaryFstreamOutputArchive |
( |
const char * |
filename = nullptr, |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::out | std::ios_base::trunc |
|
) |
| |
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 write to. |
| [in] | mode | I/O attributes for opening the file. |
References madness::filename, and open().
◆ BinaryFstreamOutputArchive() [2/2]
| madness::archive::BinaryFstreamOutputArchive::BinaryFstreamOutputArchive |
( |
const std::string |
name, |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::out | std::ios_base::trunc |
|
) |
| |
|
inline |
◆ close()
| void madness::archive::BinaryFstreamOutputArchive::close |
( |
| ) |
|
◆ flush()
| void madness::archive::BinaryFstreamOutputArchive::flush |
( |
| ) |
|
Flush the filestream.
References os.
◆ open()
| void madness::archive::BinaryFstreamOutputArchive::open |
( |
const char * |
filename, |
|
|
std::ios_base::openmode |
mode = std::ios_base::binary | std::ios_base::out | std::ios_base::trunc |
|
) |
| |
◆ store()
Write to the filestream.
The function only appears (due to enable_if) if T is serializable.
- Template Parameters
-
| T | The type of data to be written. |
- Parameters
-
| [in] | t | Location of the data to be written. |
| [in] | n | The number of data items to be written. |
References os, and T().
Referenced by open().
◆ iobuf
| std::shared_ptr<char> madness::archive::BinaryFstreamOutputArchive::iobuf |
|
private |
◆ IOBUFSIZE
| const std::size_t madness::archive::BinaryFstreamOutputArchive::IOBUFSIZE = 4*1024*1024 |
|
staticprivate |
Buffer size.
Referenced by open().
◆ os
| std::ofstream madness::archive::BinaryFstreamOutputArchive::os |
|
mutableprivate |
The documentation for this class was generated from the following files: