SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWObjectOutputStream Class Reference

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

#include <rw/serial/RWObjectOutputStream.h>

Inheritance diagram for RWObjectOutputStream:
RWDataOutputStream RWHandleBase

Public Member Functions

 RWObjectOutputStream (RWObjectOutputStreamImp *body)
 
 RWObjectOutputStream (const RWObjectOutputStream &handle)
 
void closeContext (bool writeContext=true)
 
void endAssoc ()
 
void endBlock ()
 
void endElement ()
 
void endMap ()
 
void endMember (const RWSymbol &memberName)
 
void endParent ()
 
void endSequence ()
 
bool needToWrite (const void *obj)
 
void newObjectMarker ()
 
void openContext (bool writeContext=true)
 
RWObjectOutputStreamoperator= (const RWObjectOutputStream &handle)
 
void putString (const RWCString &str)
 
void putString (const std::string &str)
 
void putSymbol (const RWSymbol &sym)
 
void putUString (const RWBasicUString &str)
 
void putWString (const RWWString &str)
 
void rememberObject (const void *obj)
 
void setNameForNextObject (const RWCString &instanceName)
 
void startAssocKey ()
 
void startAssocValue ()
 
void startBlock (const RWSymbol &typeInfo)
 
void startElement (int position)
 
void startMap (int count, RWStreamType keyType, RWStreamType valueType, const RWSymbol &typeInfo)
 
void startParent (const RWSymbol &typeInfo)
 
void startSequence (int count, RWStreamType elementType, const RWSymbol &typeInfo)
 
void writeMemberInfo (const RWSymbol &memberName, RWStreamType memberType)
 
void writeNullPtr ()
 
void writeTypeInfo (const RWSymbol &typeInfo)
 
- Public Member Functions inherited from RWDataOutputStream
 RWDataOutputStream (RWDataOutputStreamImp *ptr)
 
 RWDataOutputStream (const RWDataOutputStream &handle)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWDataOutputStreamoperator<< (RWDataOutputStream &(*pf)(RWDataOutputStream &))
 
RWDataOutputStream operator<< (RWDataOutputStream(*pf)(RWDataOutputStream &))
 
RWDataOutputStreamoperator<< (bool value)
 
RWDataOutputStreamoperator<< (char value)
 
RWDataOutputStreamoperator<< (unsigned char value)
 
RWDataOutputStreamoperator<< (signed char value)
 
RWDataOutputStreamoperator<< (short value)
 
RWDataOutputStreamoperator<< (unsigned short value)
 
RWDataOutputStreamoperator<< (int value)
 
RWDataOutputStreamoperator<< (unsigned int value)
 
RWDataOutputStreamoperator<< (long value)
 
RWDataOutputStreamoperator<< (unsigned long value)
 
RWDataOutputStreamoperator<< (float value)
 
RWDataOutputStreamoperator<< (double value)
 
RWDataOutputStreamoperator<< (wchar_t value)
 
RWDataOutputStreamoperator<< (long long value)
 
RWDataOutputStreamoperator<< (long double value)
 
RWDataOutputStreamoperator= (const RWDataOutputStream &handle)
 
void putBool (bool value)
 
void putBools (const bool *arrayPt, RWSize count)
 
void putChar (char value)
 
virtual void putCharacter (char value)
 
void putChars (const char *arrayPt, RWSize count)
 
void putDouble (double value)
 
void putDoubles (const double *arrayPt, RWSize count)
 
void putFloat (float value)
 
void putFloats (const float *arrayPt, RWSize count)
 
void putInt (int value)
 
void putInts (const int *arrayPt, RWSize count)
 
void putLong (long value)
 
void putLongDouble (long double value)
 
void putLongDoubles (const long double *arrayPt, RWSize count)
 
void putLongLong (long long value)
 
void putLongLongs (const long long *arrayPt, RWSize count)
 
void putLongs (const long *arrayPt, RWSize count)
 
void putShort (short value)
 
void putShorts (const short *arrayPt, RWSize count)
 
void putSignedChar (signed char value)
 
void putSignedChars (const signed char *arrayPt, RWSize count)
 
virtual void putSizeT (size_t value)
 
void putString (const char *string, RWSize count)
 
virtual void putUCharacter (RWUChar value)
 
void putUnsignedChar (unsigned char value)
 
void putUnsignedChars (const unsigned char *arrayPt, RWSize count)
 
void putUnsignedInt (unsigned int value)
 
void putUnsignedInts (const unsigned int *arrayPt, RWSize count)
 
void putUnsignedLong (unsigned long value)
 
void putUnsignedLongs (const unsigned long *arrayPt, RWSize count)
 
void putUnsignedShort (unsigned short value)
 
void putUnsignedShorts (const unsigned short *arrayPt, RWSize count)
 
void putUString (const RWUChar *ustring, RWSize count)
 
void putWchar_t (wchar_t value)
 
void putWchar_ts (const wchar_t *arrayPt, RWSize count)
 
virtual void putWCharacter (wchar_t value)
 
void putWString (const wchar_t *wstring, RWSize count)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator< (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (void)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (const RWHandleBase &second)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

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)
inlineexplicit

Constructor.

Parameters
bodyThe stream implementation to associate with this handle.
RWObjectOutputStream::RWObjectOutputStream ( const RWObjectOutputStream handle)
inline

Copy constructor. Throws no exceptions.

Parameters
handleA 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

Outputs tokens 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
memberNameIdentifies the name of the member.
void RWObjectOutputStream::endParent ( )
inline

Outputs tokens 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, outputs tokens identifying this object as having been previously streamed, 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= ( const RWObjectOutputStream handle)
inline

Assignment operator. Throws no exceptions.

Parameters
handleA data stream handle used to initialize this handle.
void RWObjectOutputStream::putString ( const RWCString str)
inline

Writes an RWCString to the stream.

void RWObjectOutputStream::putString ( const std::string &  str)
inline

Writes a std::string 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
objHolds 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

Outputs tokens that identify the start of a new object.

Parameters
typeInfoIdentifies 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
positionContains 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
countContains the number of items in the association.
keyTypeContains the type of key in the association.
valueTypeContains the type of value in the association.
typeInfoContains the type of the association (collection) itself.
void RWObjectOutputStream::startParent ( const RWSymbol typeInfo)
inline

Outputs tokens that identify the start of a parent class.

Parameters
typeInfoIdentifies 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
countContains the number of items in the collection.
elementTypeContains the type of element in the collection.
typeInfoContains 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 returns false.

Parameters
memberNameIdentifies the name of the member.
memberTypeIdentifies 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
typeInfoIdentifies the type of the new object, if such information is available.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.