Module: Advanced Tools Package: Serialization
RWObjectOutputStream RWDataOutputStream
#include <rw/serial/RWObjectOutputStream.h>
Handle class for all the object output stream implementation classes. Implements the handle idiom from the handle/body pattern. With the exception of constructors and assignment operators, all member functions forward directly to the implementation associated with this handle during construction.
RW_EXPLICIT RWObjectOutputStream(RWObjectOutputStreamImp* body);
Constructor. Parameter body is the stream implementation to associate with this handle.
RWObjectOutputStream(const RWObjectOutputStream& handle);
Copy constructor. Parameter handle is a data stream handle used to initialize the newly created handle. Throws no exceptions.
RWObjectOutputStream& operator=(const RWObjectOutputStream& handle);
Assignment operator. Throws no exceptions.
Parameter List
handle |
A data stream handle used to initialize this handle. |
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 putInsertProxy(const RWTInsertProxy<T>& ins);
Writes an RWWString to the stream.
void putString(const RWCString& str);
Writes an RWCString to the stream.
void putString(const std::string& str);
Writes a std::string 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 putSymbol(const RWSymbol& sym);
Writes an RWSymbol 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& instanceName)
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. |
© 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.