SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWObjectInputStream Class Reference

Handle class for object input stream implementation classes. More...

#include <rw/serial/RWObjectInputStream.h>

Inheritance diagram for RWObjectInputStream:
RWDataInputStream RWHandleBase

Public Member Functions

 RWObjectInputStream (const RWObjectInputStream &handle)
 
 RWObjectInputStream (RWObjectInputStreamImp *body)
 
void closeContext (bool readContext=true)
 
void endAssoc ()
 
void endBlock ()
 
void endElement ()
 
void endMap ()
 
void endMember ()
 
void endParent ()
 
void endSequence ()
 
void * getNewObject (const std::type_info *base)
 
void getString (RWCString &value)
 
void getString (std::string &value)
 
void getSymbol (RWSymbol &value)
 
void getUString (RWBasicUString &value)
 
void getWString (RWWString &value)
 
void openContext (bool readContext=true)
 
RWObjectInputStreamoperator= (const RWObjectInputStream &handle)
 
RWSymbol readTypeInfo ()
 
void rememberObject (const void *obj)
 
void startAssocKey ()
 
void startAssocValue ()
 
RWSymbol startBlock ()
 
void startElement (int &position)
 
RWSymbol startMap (int &count, RWStreamType &keyType, RWStreamType &valueType)
 
bool startMember (RWSymbol &memberName, RWStreamType &memberType)
 
void startParent (const RWSymbol &typeInfo)
 
RWSymbol startSequence (int &count, RWStreamType &elementType)
 
- Public Member Functions inherited from RWDataInputStream
 RWDataInputStream (const RWDataInputStream &handle)
 
 RWDataInputStream (RWDataInputStreamImp *ptr)
 
RWSize available () const
 
void close ()
 
void getBool (bool &value)
 
RWSize getBools (bool *arrayPt, RWSize count)
 
void getChar (char &value)
 
void getCharacter (char &value)
 
RWSize getChars (char *arrayPt, RWSize count)
 
RWSize getDelimitedString (char *string, RWSize maxCount, char delim='\0')
 
RWSize getDelimitedUString (RWUChar *ustring, RWSize maxCount, RWUChar delim)
 
RWSize getDelimitedWString (wchar_t *wstring, RWSize maxCount, wchar_t delim=L'\0')
 
void getDouble (double &value)
 
RWSize getDoubles (double *arrayPt, RWSize count)
 
void getFloat (float &value)
 
RWSize getFloats (float *arrayPt, RWSize count)
 
void getInt (int &value)
 
RWSize getInts (int *arrayPt, RWSize count)
 
void getLong (long &value)
 
void getLongDouble (long double &value)
 
RWSize getLongDoubles (long double *arrayPt, RWSize count)
 
void getLongLong (long long &value)
 
RWSize getLongLongs (long long *arrayPt, RWSize count)
 
RWSize getLongs (long *arrayPt, RWSize count)
 
void getShort (short &value)
 
RWSize getShorts (short *arrayPt, RWSize count)
 
void getSignedChar (signed char &value)
 
RWSize getSignedChars (signed char *arrayPt, RWSize count)
 
void getSizeT (size_t &value)
 
RWSize getString (char *string, RWSize count)
 
void getUCharacter (RWUChar &value)
 
void getUnsignedChar (unsigned char &value)
 
RWSize getUnsignedChars (unsigned char *arrayPt, RWSize count)
 
void getUnsignedInt (unsigned int &value)
 
RWSize getUnsignedInts (unsigned int *arrayPt, RWSize count)
 
void getUnsignedLong (unsigned long &value)
 
RWSize getUnsignedLongLongs (unsigned long long *arrayPt, RWSize count)
 
RWSize getUnsignedLongs (unsigned long *arrayPt, RWSize count)
 
void getUnsignedShort (unsigned short &value)
 
RWSize getUnsignedShorts (unsigned short *arrayPt, RWSize count)
 
RWSize getUString (RWUChar *ustring, RWSize count)
 
void getWchar_t (wchar_t &value)
 
RWSize getWchar_ts (wchar_t *arrayPt, RWSize count)
 
void getWCharacter (wchar_t &value)
 
RWSize getWString (wchar_t *wstring, RWSize count)
 
bool isBad () const
 
bool isEof () const
 
bool isFail () const
 
bool isGood () const
 
RWDataInputStreamoperator= (const RWDataInputStream &handle)
 
RWDataInputStreamoperator>> (bool &value)
 
RWDataInputStreamoperator>> (char &value)
 
RWDataInputStreamoperator>> (double &value)
 
RWDataInputStreamoperator>> (float &value)
 
RWDataInputStreamoperator>> (int &value)
 
RWDataInputStreamoperator>> (long &value)
 
RWDataInputStreamoperator>> (long double &value)
 
RWDataInputStreamoperator>> (long long &value)
 
RWDataInputStreamoperator>> (RWDataInputStream &(*pf)(RWDataInputStream &))
 
RWDataInputStream operator>> (RWDataInputStream(*pf)(RWDataInputStream &))
 
RWDataInputStreamoperator>> (short &value)
 
RWDataInputStreamoperator>> (signed char &value)
 
RWDataInputStreamoperator>> (unsigned char &value)
 
RWDataInputStreamoperator>> (unsigned int &value)
 
RWDataInputStreamoperator>> (unsigned long &value)
 
RWDataInputStreamoperator>> (unsigned short &value)
 
RWDataInputStreamoperator>> (wchar_t &value)
 
RWSize skip (RWSize numUnits)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Static Public Member Functions

static RWTFactory1< void *, RWCString, RWSymbol > * getFactory ()
 

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

RWObjectInputStream is the handle class for object input stream implementation classes. Implements the handle idiom from the handle/body pattern. With the exception of constructors, assignment operators, and getFactory(), all member functions forward directly to the implementation associated with this handle during construction.

Constructor & Destructor Documentation

◆ RWObjectInputStream() [1/2]

RWObjectInputStream::RWObjectInputStream ( RWObjectInputStreamImp * body)
inlineexplicit

Constructor.

Parameters
bodyStream Implementation to associate with this handle.

◆ RWObjectInputStream() [2/2]

RWObjectInputStream::RWObjectInputStream ( const RWObjectInputStream & handle)
inline

Copy constructor. Throws no exceptions.

Parameters
handleData stream handle used to initialize this handle.

Member Function Documentation

◆ closeContext()

void RWObjectInputStream::closeContext ( bool readContext = true)
inline

Called by RWWithObjectInputContext dtor to close an open context.

◆ endAssoc()

void RWObjectInputStream::endAssoc ( )
inline

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

◆ endBlock()

void RWObjectInputStream::endBlock ( )
inline

Inputs tokens that identify the end of an object.

◆ endElement()

void RWObjectInputStream::endElement ( )
inline

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

◆ endMap()

void RWObjectInputStream::endMap ( )
inline

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

◆ endMember()

void RWObjectInputStream::endMember ( )
inline

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

◆ endParent()

void RWObjectInputStream::endParent ( )
inline

Inputs tokens that identify the end of an parent class.

◆ endSequence()

void RWObjectInputStream::endSequence ( )
inline

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

◆ getFactory()

static RWTFactory1< void *, RWCString, RWSymbol > * RWObjectInputStream::getFactory ( )
static

Obtains the singleton factory used to create objects dynamically from streams.

◆ getNewObject()

void * RWObjectInputStream::getNewObject ( const std::type_info * base)
inline

Reads the dynamic type information (derived class) from the input stream, and factories an instance of this type.

Parameters
baseThe static type (base class) of the field being read.

◆ getString() [1/2]

void RWObjectInputStream::getString ( RWCString & value)
inline

Reads an RWCString value from the stream.

Parameters
valueThe RWCString value to be read from the stream.

◆ getString() [2/2]

void RWObjectInputStream::getString ( std::string & value)
inline

Reads a std::string value from the stream.

Parameters
valueThe std::string value to be read from the stream.

◆ getSymbol()

void RWObjectInputStream::getSymbol ( RWSymbol & value)
inline

Reads an RWSymbol value from the stream.

Parameters
valueThe RWSymbol value to be read from the stream.

◆ getUString()

void RWObjectInputStream::getUString ( RWBasicUString & value)
inline

Reads an RWBasicUString value from the stream.

Parameters
valueThe RWBasicUString value to be read from the stream.

◆ getWString()

void RWObjectInputStream::getWString ( RWWString & value)
inline

Reads an RWWString value from the stream.

Parameters
valueThe RWWString value to be read from the stream.

◆ openContext()

void RWObjectInputStream::openContext ( bool readContext = true)
inline

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

◆ operator=()

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

Assignment operator. Throws no exceptions.

Parameters
handleData stream handle used to initialize this handle.

◆ readTypeInfo()

RWSymbol RWObjectInputStream::readTypeInfo ( )
inline

Reads the type information for a class instance from the stream and returns it as a symbol.

◆ rememberObject()

void RWObjectInputStream::rememberObject ( const void * obj)
inline

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

◆ startAssocKey()

void RWObjectInputStream::startAssocKey ( )
inline

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

◆ startAssocValue()

void RWObjectInputStream::startAssocValue ( )
inline

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

◆ startBlock()

RWSymbol RWObjectInputStream::startBlock ( )
inline

Inputs tokens that identify the start of a new object. Returns an RWSymbol representing the new object. Depending on the implementation class associated with this handle, the RWSymbol may be empty.

◆ startElement()

void RWObjectInputStream::startElement ( int & position)
inline

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

Parameters
positionContains the position of the element in the collection.

◆ startMap()

RWSymbol RWObjectInputStream::startMap ( int & count,
RWStreamType & keyType,
RWStreamType & valueType )
inline

Called by the input operators for association types (hash tables, etc.) at the start of a sequence. Returns an RWSymbol representing the collection.

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.

◆ startMember()

bool RWObjectInputStream::startMember ( RWSymbol & memberName,
RWStreamType & memberType )
inline

Called for before each data member by the streamContents() function. Metadata about the field may or may not be read from the stream depending on the implementation. If data is read, returns true and parameter memberName will contain the name of the member; otherwise returns false.

◆ startParent()

void RWObjectInputStream::startParent ( const RWSymbol & typeInfo)
inline

Inputs tokens that identify the start of a parent class.

Parameters
typeInfoIdentifies the type of the parent class, if such information is available.

◆ startSequence()

RWSymbol RWObjectInputStream::startSequence ( int & count,
RWStreamType & elementType )
inline

Called by the input operators for collection types at the start of a sequence. Returns an RWSymbol representing the collection.

Parameters
countContains the number of items in the collection.
elementTypeContains the type of element in the collection.

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