Module: Advanced Tools Package: Serialization
RWCompactObjectOutputStreamImp RWObjectOutputStreamImp RWFilteredDataOutputStreamImp
#include <rw/serial/RWCompactObjectOutputStreamImp.h>
The class RWCompactObjectOutputStreamImp writes objects in a compact format to the supplied RWDataOutputStream. 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.
// Create a strstream to serve as our sink ostrstream s; // Create a compact data stream using the strstream RWObjectOutputStream in = RWCompactObjectOutputStreamImp::make(
RWDataToVirtualOutputStream(s)); // Write integer value 1 to compact data stream s << 1;
RWCompactObjectOutputStreamImp(RWDataOutputStream& sinkStream,bool annotateStream)
Used by derived classes to initialize the next processing stream. Throws no exceptions.
Parameter List
sinkStream |
Handle to the next processing stream. |
annotateStream |
Indicates whether or not the stream will be annotated. |
static RWObjectOutputStream make(RWDataOutputStream& sink, bool annotateStream = false);
Constructs an RWCompactObjectOutputStreamImp instance that uses the parameter sink as its sink of bytes, and returns a handle to it. Throws no exceptions.
Parameter List
sink |
Data stream that is used as sink of bytes. |
annotateStream |
Indicates whether or not the stream will be 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.