Module: Advanced Tools Package: Serialization
RWObjectOutputStreamImp RWFilteredDataOutputStreamImp
#include <rw/serial/RWObjectOutputStreamImp.h>
Base class impl for all object output streams. Inherits default operations for streaming primitives from the data output stream.
See the corresponding handle class, RWObjectOutputStream, for the description of the object output stream interface.
RWObjectOutputStreamImp(RWDataOutputStream& sinkStream);
Used by derived classes to initialize the next processing stream. Throws no exceptions.
Parameter List
sinkStream |
A handle to the next processing stream. |
void closeContext(bool writeContext = true);
Called by RWWithObjectOutputContext dtor to close an open context.
void endAssoc();
Called by the output operators for association types after each value.
void endBlock();
Causes tokens to be output that identify the end of an object.
void endElement();
Called by the output operators for collection types after each element in a sequence.
void endMap();
Called by the output operators for association types after all the pairs.
void endMember(const RWSymbol& memberName);
Called by streamContents() after each data member is written.
Parameter List
memberName |
Identifies the name of the member. |
void endParent();
Causes tokens to be output that identify the end of an parent class.
void endSequence();
Called by the output operators for collection types at the end of a sequence.
bool needToWrite(const void* obj);
Returns true when the referenced object has not yet been written to the stream in the current context. Otherwise, tokens are output identifying this object as a previously streamed one, and the function returns false.
void newObjectMarker();
Output is a token indicating that an object will be created by the factory.
void openContext(bool writeContext = true);
Called by RWWithObjectOutputContext ctor to open a context in which multiple references to a single object are resolved.
void putString(const RWCString& str);
Writes an RWCString to the stream.
void putSymbol(const RWSymbol& sym);
Writes an RWSymbol to the stream.
void putUString(const RWBasicUString& str);
Writes an RWBasicUString to the stream.
void putWString(const RWWString& str);
Writes an RWWString to the stream.
void rememberObject(const void* obj);
Called by streaming operators to record each instance streamed out, in case it is referenced again in the same context.
Parameter List
obj |
Holds the address of the instance. |
void setNameForNextObject(const RWCString& str);
Sets up the instance name for the next object to be written out.
void startAssocKey();
Called by the output operators for association types before each key.
void startAssocValue();
Called by the output operators for association types after each key and before each value.
void startBlock(const RWSymbol& typeInfo);
Causes tokens to be output that identify the start of a new object.
Parameter List
typeInfo |
Identifies the type of the new object, if such information is available. |
void startElement(int position);
Called by the output operators for collection types before each element in a sequence.
Parameter List
position |
Contains the position of the element. |
void startMap(int count, RWStreamType keyType, RWStreamType valueType, const RWSymbol& typeInfo);
Called by the output operators for association types (hash tables, etc.) at the start.
Parameter List
count |
Contains the number of items in the association. |
keyType |
Contains the type of key in the association. |
valueType |
Contains the type of value in the association. |
typeInfo |
Contains the type of the association(collection) itself |
void startParent(const RWSymbol& typeInfo);
Causes tokens to be output that identify the start of a parent class.
Parameter List
typeInfo |
Identifies the type of the parent class, if such information is available. |
void startSequence(int count, RWStreamType elementType, const RWSymbol& typeInfo);
Called by the output operators for collection types at the start of a sequence.
Parameter List
count |
Contains the number of items in the collection. |
elementType |
Contains the type of element in the collection. |
typeInfo |
Contains the type of the collection itself. |
void writeMemberInfo(const RWSymbol& memberName, RWStreamType memberType);
Called for before each data member by the streamContents() function. Metadata about the field may or may not be written to the stream, depending on the implementation. This function returns true if data is actually written out. Otherwise, it returns false.
Parameter List
memberName |
Identifies the name of the member. |
memberType |
Identifies the type of the member. |
void writeNullPtr();
Output is a token representing a null pointer.
void writeTypeInfo(const RWSymbol& typeInfo);
Outputs the type information required to factory an object of the correct dynamic type (derived class) on input.
Parameter List
typeInfo |
Identifies the type of the new object, if such information is available. |
int getContextNestingLevel();
Returns the current context nesting level. 0 indicates no open context.
virtual void closeOuterContext(bool writeContext) = 0;
Really closes an open context. This function is called when the number of closeContext() calls matches the number of openContext() calls.
virtual void openOuterContext(bool writeContext) = 0;
Really opens a new context. This function is called by openContext() when a context is not already open.
RWCString nameForNextObject_;
The name for the next object inserted or extracted. This name will be cleared as soon as an object has been written or read, and ignored if empty.
© 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.