Module: Advanced Tools Package: Serialization
RWCompactObjectInputStreamImp RWObjectInputStreamImp RWFilteredDataInputStreamImp
#include <rw/serial/RWCompactObjectInputStreamImp.h>
The class RWCompactObjectInputStreamImp reads objects encoded in a compact format from the supplied RWDataInputStream. The format of this stream resembles that produced when RWCollectables are persisted using RW virtual streams. Implements the body idiom from the handle/body pattern. The stream can optionally be annotated with member (attribute) name and type information to support generic parsing.
// Open an fstream to serve as our source. ifstream s("foo.dat"); // Create a compact data stream using the fstream. RWObjectInputStream in = RWCompactObjectInputStreamImp::make(
RWDataToVirtualInputStream(s)); // Read integer from compact data stream int i; s >> i;
RWCompactObjectInputStreamImp(RWDataInputStream& sourceStream,bool annotateStream)
Used by derived classes to initialize the next processing stream. Throws no exceptions.
Parameter List
sourceStream |
Serves as a handle to the previous processing stream. |
annotateStream |
Indicates whether or not the stream is annotated. |
static RWObjectInputStream make(RWDataInputStream& source, bool annotateStream = false);
Constructs an RWCompactObjectInputStreamImp instance that uses source as its source of bytes, and returns a handle to it. Throws no exceptions.
Parameter List
source |
Data stream that is used as source of bytes. |
annotateStream |
Indicates whether or not the stream is annotated. |
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.