|
FEAT 3
Finite Element Analysis Toolbox
|
Binary Stream class. More...
#include <binary_stream.hpp>
Public Member Functions | |
| BinaryStream () | |
| default CTOR More... | |
| void | clear () |
| Clears the current stream. More... | |
| std::vector< char > & | container () |
| Returns a reference to the internal vector container. More... | |
| const std::vector< char > & | container () const |
| Returns a reference to the internal vector container. More... | |
| char * | data () |
| Returns the data array of the stream. More... | |
| const char * | data () const |
| Returns the data array of the stream. More... | |
| void | read_stream (std::istream &is) |
| Reads the content of a binary input stream. More... | |
| std::streamsize | size () const |
| Returns the current size of the stream. More... | |
| void | write_stream (std::ostream &os) const |
| Writes the content to a binary output stream. More... | |
Private Attributes | |
| BinaryBuffer | _buffer |
Binary Stream class.
This class implements a dynamic binary memory input/output stream implementing the std::iostream interface.
This class can be used to write and read binary data into/from memory to test functions which usually use the std::[i|o]fstream classes for input and output from/into files.
This class is the binary counterpart of the text-based std::stringstream class.
Definition at line 28 of file binary_stream.hpp.
|
inline |
default CTOR
Definition at line 192 of file binary_stream.hpp.
|
inline |
Clears the current stream.
Definition at line 209 of file binary_stream.hpp.
Referenced by read_stream().
|
inline |
Returns a reference to the internal vector container.
Definition at line 236 of file binary_stream.hpp.
Referenced by FEAT::Dist::Comm::bcast_binarystream(), FEAT::DistFileIO::read_combined(), FEAT::Control::Domain::PartiDomainControlBase< DomainLevel_ >::serialize_partitioning(), and FEAT::DistFileIO::write_combined().
|
inline |
Returns a reference to the internal vector container.
Definition at line 245 of file binary_stream.hpp.
|
inline |
Returns the data array of the stream.
Definition at line 218 of file binary_stream.hpp.
Referenced by FEAT::Control::CheckpointControl::load(), FEAT::DistFileIO::write_ordered(), and write_stream().
|
inline |
Returns the data array of the stream.
Definition at line 227 of file binary_stream.hpp.
|
inline |
Reads the content of a binary input stream.
This function copies the content of the input stream into this binary stream object. The previous content of this binary stream (if any) is discarded.
| [in] | is | The input stream from which to read. |
Definition at line 260 of file binary_stream.hpp.
References clear().
Referenced by FEAT::DistFileIO::_read_file().
|
inline |
Returns the current size of the stream.
Definition at line 201 of file binary_stream.hpp.
Referenced by FEAT::DistFileIO::write_ordered(), and write_stream().
|
inline |
Writes the content to a binary output stream.
This function writes the content of this binary stream at the current position of the output stream object.
| [in] | os | The output stream to which to write to. |
Definition at line 292 of file binary_stream.hpp.
References data(), and size().
Referenced by FEAT::DistFileIO::_write_file().
|
private |
Definition at line 188 of file binary_stream.hpp.