GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
graphlab::iarchive Class Reference

The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities. More...

#include <graphlab/serialization/iarchive.hpp>

List of all members.

Public Member Functions

char read_char ()
 Directly reads a single character from the input stream.
void read (char *c, size_t l)
bool fail ()
 Returns true if the underlying stream is in a failure state.
 iarchive (std::istream &instream)
 iarchive (const char *buf, size_t len)

Public Attributes

std::istream * in
const char * buf
size_t off
size_t len

Detailed Description

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 graphlab::oarchive), in the form of a standard input stream, you can construct an iarchive object by:

// where strm is an istream object
graphlab::iarchive iarc(strm);

For instance, to deserialize from a file,

std::ifstream fin("inputfile.bin");
graphlab::iarchive iarc(fin);

Once the iarc object is constructed, Serializable objects can be read from it using the >> stream operator.

iarc >> a >> b >> c;

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 graphlab/serialization/serialization_includes.hpp

Definition at line 77 of file iarchive.hpp.


Constructor & Destructor Documentation

graphlab::iarchive::iarchive ( std::istream &  instream)
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 121 of file iarchive.hpp.


Member Function Documentation

void graphlab::iarchive::read ( char *  c,
size_t  l 
)
inline

Directly reads a sequence of "len" bytes from the input stream into the location pointed to by "c"

Definition at line 100 of file iarchive.hpp.


The documentation for this class was generated from the following file: