Turi Create
4.0
|
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities. More...
#include <core/storage/serialization/iarchive.hpp>
Public Member Functions | |
iarchive (std::istream &instream) | |
char | read_char () |
Directly reads a single character from the input stream. | |
void | read (char *c, size_t l) |
template<typename T > | |
void | read_into (T &c) |
bool | fail () |
Returns true if the underlying stream is in a failure state. | |
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
Given a source of serialized bytes (written by an turi::oarchive), in the form of a standard input stream, you can construct an iarchive object by:
For instance, to deserialize from a file,
Once the iarc object is constructed, Serializable objects can be read from it using the >> stream operator.
Alternatively, data can be directly read from the stream using the iarchive::read() and iarchive::read_char() functions.
For more usage details, see serialization
The iarchive object should not be used once the associated stream object is closed or is destroyed.
To use this class, include core/storage/serialization/serialization_includes.hpp
Definition at line 60 of file iarchive.hpp.
|
inline |
Constructs an iarchive object. Takes a reference to a generic std::istream object and associates the archive with it. Reads from the archive will read from the assiciated input stream.
Definition at line 75 of file iarchive.hpp.
|
inline |
Directly reads a sequence of "len" bytes from the input stream into the location pointed to by "c"
Definition at line 103 of file iarchive.hpp.
|
inline |
Directly reads a sequence of "len" bytes from the input stream into the location pointed to by "c"
Definition at line 118 of file iarchive.hpp.