SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWObjectOutputStream &handle)
 
 RWObjectOutputStream (RWObjectOutputStreamImp *body)
 
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 (const RWDataOutputStream &handle)
 
 RWDataOutputStream (RWDataOutputStreamImp *ptr)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWDataOutputStreamoperator<< (bool value)
 
RWDataOutputStreamoperator<< (char value)
 
RWDataOutputStreamoperator<< (double value)
 
RWDataOutputStreamoperator<< (float value)
 
RWDataOutputStreamoperator<< (int value)
 
RWDataOutputStreamoperator<< (long double value)
 
RWDataOutputStreamoperator<< (long long value)
 
RWDataOutputStreamoperator<< (long value)
 
RWDataOutputStreamoperator<< (RWDataOutputStream &(*pf)(RWDataOutputStream &))
 
RWDataOutputStream operator<< (RWDataOutputStream(*pf)(RWDataOutputStream &))
 
RWDataOutputStreamoperator<< (short value)
 
RWDataOutputStreamoperator<< (signed char value)
 
RWDataOutputStreamoperator<< (unsigned char value)
 
RWDataOutputStreamoperator<< (unsigned int value)
 
RWDataOutputStreamoperator<< (unsigned long value)
 
RWDataOutputStreamoperator<< (unsigned short value)
 
RWDataOutputStreamoperator<< (wchar_t 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
 

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~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() [1/2]

RWObjectOutputStream::RWObjectOutputStream ( RWObjectOutputStreamImp * body)
inlineexplicit

Constructor.

Parameters
bodyThe stream implementation to associate with this handle.

◆ RWObjectOutputStream() [2/2]

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

◆ closeContext()

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

Called by RWWithObjectOutputContext dtor to close an open context.

◆ endAssoc()

void RWObjectOutputStream::endAssoc ( )
inline

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

◆ endBlock()

void RWObjectOutputStream::endBlock ( )
inline

Outputs tokens that identify the end of an object.

◆ endElement()

void RWObjectOutputStream::endElement ( )
inline

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

◆ endMap()

void RWObjectOutputStream::endMap ( )
inline

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

◆ endMember()

void RWObjectOutputStream::endMember ( const RWSymbol & memberName)
inline

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

Parameters
memberNameIdentifies the name of the member.

◆ endParent()

void RWObjectOutputStream::endParent ( )
inline

Outputs tokens that identify the end of an parent class.

◆ endSequence()

void RWObjectOutputStream::endSequence ( )
inline

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

◆ needToWrite()

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.

◆ newObjectMarker()

void RWObjectOutputStream::newObjectMarker ( )
inline

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

◆ openContext()

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.

◆ operator=()

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

Assignment operator. Throws no exceptions.

Parameters
handleA data stream handle used to initialize this handle.

◆ putString() [1/2]

void RWObjectOutputStream::putString ( const RWCString & str)
inline

Writes an RWCString to the stream.

◆ putString() [2/2]

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

Writes a std::string to the stream.

◆ putSymbol()

void RWObjectOutputStream::putSymbol ( const RWSymbol & sym)
inline

Writes an RWSymbol to the stream.

◆ putUString()

void RWObjectOutputStream::putUString ( const RWBasicUString & str)
inline

Writes an RWBasicUString to the stream.

◆ putWString()

void RWObjectOutputStream::putWString ( const RWWString & str)
inline

Writes an RWWString to the stream.

◆ rememberObject()

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.

◆ setNameForNextObject()

void RWObjectOutputStream::setNameForNextObject ( const RWCString & instanceName)
inline

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

◆ startAssocKey()

void RWObjectOutputStream::startAssocKey ( )
inline

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

◆ startAssocValue()

void RWObjectOutputStream::startAssocValue ( )
inline

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

◆ startBlock()

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.

◆ startElement()

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.

◆ startMap()

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.

◆ startParent()

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.

◆ startSequence()

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.

◆ writeMemberInfo()

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.

◆ writeNullPtr()

void RWObjectOutputStream::writeNullPtr ( )
inline

Output is a token representing a null pointer.

◆ writeTypeInfo()

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.