rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWObjectOutputStream Class Reference
[Serialization]

Handle class for all the object output stream implementation classes. More...

#include <rw/serial/RWObjectOutputStream.h>

Inheritance diagram for RWObjectOutputStream:
RWDataOutputStream RWHandleBase

List of all members.

Public Member Functions

 RWObjectOutputStream (RWObjectOutputStreamImp *body)
 RWObjectOutputStream (const RWObjectOutputStream &handle)
RWObjectOutputStreamoperator= (const RWObjectOutputStream &handle)
void openContext (bool writeContext=true)
void closeContext (bool writeContext=true)
void startBlock (const RWSymbol &typeInfo)
void endBlock ()
void startParent (const RWSymbol &typeInfo)
void endParent ()
bool needToWrite (const void *obj)
void writeNullPtr ()
void newObjectMarker ()
void writeTypeInfo (const RWSymbol &typeInfo)
void rememberObject (const void *obj)
void writeMemberInfo (const RWSymbol &memberName, RWStreamType memberType)
void endMember (const RWSymbol &memberName)
void startSequence (int count, RWStreamType elementType, const RWSymbol &typeInfo)
void startElement (int position)
void endElement ()
void endSequence ()
void startMap (int count, RWStreamType keyType, RWStreamType valueType, const RWSymbol &typeInfo)
void startAssocKey ()
void startAssocValue ()
void endAssoc ()
void endMap ()
void putSymbol (const RWSymbol &sym)
void putString (const RWCString &str)
void putString (const std::string &str)
void putWString (const RWWString &str)
void putUString (const RWBasicUString &str)
void setNameForNextObject (const RWCString &instanceName)
RWObjectOutputStreamoperator<< (char value)
RWObjectOutputStreamoperator<< (unsigned char value)
RWObjectOutputStreamoperator<< (signed char value)
RWObjectOutputStreamoperator<< (short value)
RWObjectOutputStreamoperator<< (unsigned short value)
RWObjectOutputStreamoperator<< (int value)
RWObjectOutputStreamoperator<< (unsigned int value)
RWObjectOutputStreamoperator<< (long value)
RWObjectOutputStreamoperator<< (unsigned long value)
RWObjectOutputStreamoperator<< (float value)
RWObjectOutputStreamoperator<< (double value)
RWObjectOutputStreamoperator<< (bool value)
RWObjectOutputStreamoperator<< (wchar_t value)
RWObjectOutputStreamoperator<< (long long value)
RWObjectOutputStreamoperator<< (long double value)

Detailed Description

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.


Constructor & Destructor Documentation

RWObjectOutputStream::RWObjectOutputStream ( RWObjectOutputStreamImp body  )  [inline, explicit]

Constructor.

Parameters:
body The stream implementation to associate with this handle.
RWObjectOutputStream::RWObjectOutputStream ( const RWObjectOutputStream handle  )  [inline]

Copy constructor. Throws no exceptions.

Parameters:
handle A data stream handle used to initialize the newly created handle.

Member Function Documentation

void RWObjectOutputStream::closeContext ( bool  writeContext = true  )  [inline]

Called by RWWithObjectOutputContext dtor to close an open context.

void RWObjectOutputStream::endAssoc (  )  [inline]

Called by the output operators for association types after each value.

void RWObjectOutputStream::endBlock (  )  [inline]

Causes tokens to be output that identify the end of an object.

void RWObjectOutputStream::endElement (  )  [inline]

Called by the output operators for collection types after each element in a sequence.

void RWObjectOutputStream::endMap (  )  [inline]

Called by the output operators for association types after all the pairs.

void RWObjectOutputStream::endMember ( const RWSymbol memberName  )  [inline]

Called by streamContents() after each data member is written.

Parameters:
memberName Identifies the name of the member.
void RWObjectOutputStream::endParent (  )  [inline]

Causes tokens to be output that identify the end of an parent class.

void RWObjectOutputStream::endSequence (  )  [inline]

Called by the output operators for collection types at the end of a sequence.

bool RWObjectOutputStream::needToWrite ( const void *  obj  )  [inline]

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 RWObjectOutputStream::newObjectMarker (  )  [inline]

Output is a token indicating that an object will be created by the factory.

void RWObjectOutputStream::openContext ( bool  writeContext = true  )  [inline]

Called by RWWithObjectOutputContext ctor to open a context in which multiple references to a single object are resolved.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( long double  value  )  [inline]

Writes a long double value to the stream.

Parameters:
value The long double value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( long long  value  )  [inline]

Writes a long long value to the stream.

Parameters:
value The long long value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( wchar_t  value  )  [inline]

Writes a wchar_t value to the stream.

Parameters:
value The wchar_t value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( bool  value  )  [inline]

Writes a bool value to the stream.

Parameters:
value The bool value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( double  value  )  [inline]

Writes a double value to the stream.

Parameters:
value The double value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( float  value  )  [inline]

Writes a float value to the stream.

Parameters:
value The float value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( unsigned long  value  )  [inline]

Writes an unsigned long value to the stream.

Parameters:
value The unsigned long value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( long  value  )  [inline]

Writes a long value to the stream.

Parameters:
value The long value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( unsigned int  value  )  [inline]

Writes an unsigned int value to the stream.

Parameters:
value The unsigned int value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( int  value  )  [inline]

Writes an int value to the stream.

Parameters:
value The int value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( unsigned short  value  )  [inline]

Writes an unsigned short value to the stream.

Parameters:
value The unsigned short to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( short  value  )  [inline]

Writes a short value to the stream.

Parameters:
value The short to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( signed char  value  )  [inline]

Writes a signed char value to the stream.

Parameters:
value The signed char value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( unsigned char  value  )  [inline]

Writes an unsigned char value to the stream.

Parameters:
value The unsigned char value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator<< ( char  value  )  [inline]

Writes a char value to the stream.

Parameters:
value The char value to be written to the stream.

Reimplemented from RWDataOutputStream.

RWObjectOutputStream& RWObjectOutputStream::operator= ( const RWObjectOutputStream handle  )  [inline]

Assignment operator. Throws no exceptions.

Parameters:
handle A data stream handle used to initialize this handle.
void RWObjectOutputStream::putString ( const std::string &  str  )  [inline]

Writes a std::string to the stream.

void RWObjectOutputStream::putString ( const RWCString str  )  [inline]

Writes an RWCString to the stream.

void RWObjectOutputStream::putSymbol ( const RWSymbol sym  )  [inline]

Writes an RWSymbol to the stream.

void RWObjectOutputStream::putUString ( const RWBasicUString str  )  [inline]

Writes an RWBasicUString to the stream.

void RWObjectOutputStream::putWString ( const RWWString str  )  [inline]

Writes an RWWString to the stream.

void RWObjectOutputStream::rememberObject ( const void *  obj  )  [inline]

Called by streaming operators to record each instance streamed out, in case it is referenced again in the same context.

Parameters:
obj Holds the address of the instance.
void RWObjectOutputStream::setNameForNextObject ( const RWCString instanceName  )  [inline]

Sets up the instance name for the next object to be written out.

void RWObjectOutputStream::startAssocKey (  )  [inline]

Called by the output operators for association types before each key.

void RWObjectOutputStream::startAssocValue (  )  [inline]

Called by the output operators for association types after each key and before each value.

void RWObjectOutputStream::startBlock ( const RWSymbol typeInfo  )  [inline]

Causes tokens to be output that identify the start of a new object.

Parameters:
typeInfo Identifies the type of the new object, if such information is available.
void RWObjectOutputStream::startElement ( int  position  )  [inline]

Called by the output operators for collection types before each element in a sequence.

Parameters:
position Contains the position of the element.
void RWObjectOutputStream::startMap ( int  count,
RWStreamType  keyType,
RWStreamType  valueType,
const RWSymbol typeInfo 
) [inline]

Called by the output operators for association types (hash tables, etc.) at the start.

Parameters:
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 RWObjectOutputStream::startParent ( const RWSymbol typeInfo  )  [inline]

Causes tokens to be output that identify the start of a parent class.

Parameters:
typeInfo Identifies the type of the parent class, if such information is available.
void RWObjectOutputStream::startSequence ( int  count,
RWStreamType  elementType,
const RWSymbol typeInfo 
) [inline]

Called by the output operators for collection types at the start of a sequence.

Parameters:
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 RWObjectOutputStream::writeMemberInfo ( const RWSymbol memberName,
RWStreamType  memberType 
) [inline]

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.

Parameters:
memberName Identifies the name of the member.
memberType Identifies the type of the member.
void RWObjectOutputStream::writeNullPtr (  )  [inline]

Output is a token representing a null pointer.

void RWObjectOutputStream::writeTypeInfo ( const RWSymbol typeInfo  )  [inline]

Outputs the type information required to factory an object of the correct dynamic type (derived class) on input.

Parameters:
typeInfo Identifies the type of the new object, if such information is available.
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.