SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Protected Member Functions
RWObjectInputStreamImp Class Referenceabstract

Base class for all object input stream implementations. More...

#include <rw/serial/RWObjectInputStreamImp.h>

Inheritance diagram for RWObjectInputStreamImp:
RWFilteredDataInputStreamImp RWDataInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock > RWCompactObjectInputStreamImp RWEnhancedXmlObjectInputStreamImp RWXmlObjectInputStreamImp RWTParsedTransformObjectInputStreamImp< Transform > RWTTransformObjectInputStreamImp< Transform >

Public Member Functions

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

Protected Member Functions

 RWObjectInputStreamImp (const RWDataInputStream &sourceStream)
 
virtual void closeOuterContext (bool readContext)=0
 
virtual RWSize getString (char *string, RWSize count)
 
virtual RWSize getUString (RWUChar *ustring, RWSize count)
 
virtual RWSize getWString (wchar_t *wstring, RWSize count)
 
virtual void openOuterContext (bool readContext)=0
 
- Protected Member Functions inherited from RWFilteredDataInputStreamImp
 RWFilteredDataInputStreamImp (const RWDataInputStream &sourceStream)
 
RWDataInputStreamgetSourceStream ()
 
const RWDataInputStreamgetSourceStream () const
 
- Protected Member Functions inherited from RWDataInputStreamImp
 RWDataInputStreamImp ()
 
- Protected Member Functions inherited from RWInputStreamImp
 RWInputStreamImp ()
 
- Protected Member Functions inherited from RWStreamImp
 RWStreamImp ()
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (void)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (const RWBodyBase &second)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (unsigned initCount=0)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor ()
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 ~RWTMonitor ()
 
void acquire ()
 
bool isAcquired () const
 
RWTMonitor< RWMutexLock > & monitor () const
 
RWMutexLockmutex ()
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release ()
 
bool tryAcquire ()
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

Detailed Description

Base class for all object input stream implementations. The derivation from filtered data input stream provides default implementations for output of all primitive types and allows the low level stream formatting to be controlled by delegation to a separate data input stream object.

See the corresponding handle class, RWObjectInputStream, for the description of the object input stream interface.

See also
RWObjectInputStream

Constructor & Destructor Documentation

RWObjectInputStreamImp::RWObjectInputStreamImp ( const RWDataInputStream sourceStream)
inlineprotected

Used by derived classes to initialize the attached source stream. Throws no exceptions.

Parameters
sourceStreamHandle to the attached source stream.

Member Function Documentation

virtual void RWObjectInputStreamImp::closeContext ( bool  readContext = true)
inlinevirtual

Called by RWWithObjectInputContext dtor to close an open context.

virtual void RWObjectInputStreamImp::closeOuterContext ( bool  readContext)
protectedpure virtual

Really closes an open context, called when closeContext() calls match the number of openContext() calls.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endAssoc ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endBlock ( )
pure virtual

Inputs tokens that identify the end of an object.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endElement ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endMap ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endMember ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::endParent ( )
inlinevirtual

Inputs tokens that identify the end of an parent class.

virtual void RWObjectInputStreamImp::endSequence ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getChar ( char &  value)
virtual

Forward reads a single char value from the attached source stream. Value stored by peekChar() is used if available.

Parameters
valueThe char value to be read from the attached source stream.

Reimplemented from RWFilteredDataInputStreamImp.

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getCharacter ( char &  value)
virtual

Forward reads a single char value from the attached source stream. Value stored by peekCharacter() is used if available.

Parameters
valueThe char value to be read from the attached source stream.

Reimplemented from RWFilteredDataInputStreamImp.

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void* RWObjectInputStreamImp::getNewObject ( const std::type_info *  base)
pure virtual

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

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

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getString ( RWCString value)
pure virtual

Reads an RWCString value from the stream.

Parameters
valueThe RWCString value to be read from the stream.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual RWSize RWObjectInputStreamImp::getString ( char *  string,
RWSize  count 
)
inlineprotectedvirtual

Forward the reading of a string of narrow characters from the attached source stream. The function returns the number of narrow characters read.

Parameters
stringA pointer to the first element of the string. The string must have been pre-allocated to contain at least count narrow characters.
countThe number of narrow character(s) to be read from the stream.

Reimplemented from RWFilteredDataInputStreamImp.

Reimplemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getSymbol ( RWSymbol value)
virtual

Reads an RWSymbol value from the stream.

Parameters
valueThe RWSymbol value to be read from the stream.

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getUString ( RWBasicUString value)
pure virtual

Reads an RWBasicUString value from the stream.

Parameters
valueThe RWBasicUString value to be read from the stream.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual RWSize RWObjectInputStreamImp::getUString ( RWUChar ustring,
RWSize  count 
)
inlineprotectedvirtual

Forward the reading of a string of UTF-16 characters from the attached source stream. The function returns the number of UTF-16 characters read.

Parameters
ustringA pointer to the first element of the string. The string must have been pre-allocated to contain at least count unicode characters.
countThe number of unicode character(s) to be read from the stream.

Reimplemented from RWFilteredDataInputStreamImp.

Reimplemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::getWString ( RWWString value)
pure virtual

Reads an RWWString value from the stream.

Parameters
valueThe RWWString value to be read from the stream.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual RWSize RWObjectInputStreamImp::getWString ( wchar_t *  wstring,
RWSize  count 
)
inlineprotectedvirtual

Forward the reading of a string of wide characters from the attached source stream. The function returns the number of wide characters read.

Parameters
wstringA pointer to the first element of the string. The string must have been pre-allocated to contain at least count wide characters.
countThe number of wide character(s) to be read from the stream.

Reimplemented from RWFilteredDataInputStreamImp.

Reimplemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::openContext ( bool  readContext = true)
inlinevirtual

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

virtual void RWObjectInputStreamImp::openOuterContext ( bool  readContext)
protectedpure virtual

Really opens a new context, called by openContext() when a context is not already open.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::peekChar ( char &  value)
virtual

Forward reads a single char value from the attached source stream. Value is stored for subsequent call to getChar().

Parameters
valueThe char value to be read from the attached source stream.
virtual void RWObjectInputStreamImp::peekCharacter ( char &  value)
virtual

Forward reads a single char value from the attached source stream. Value is stored for subsequent call to getCharacter().

Parameters
valueThe char value to be read from the attached source stream.
virtual RWSymbol RWObjectInputStreamImp::readTypeInfo ( )
pure virtual

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

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::rememberObject ( const void *  obj)
pure virtual

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

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::startAssocKey ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual void RWObjectInputStreamImp::startAssocValue ( )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual RWSymbol RWObjectInputStreamImp::startBlock ( )
pure virtual

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.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::startElement ( int &  )
inlinevirtual

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

Reimplemented in RWXmlObjectInputStreamImp, and RWEnhancedXmlObjectInputStreamImp.

virtual RWSymbol RWObjectInputStreamImp::startMap ( int &  count,
RWStreamType keyType,
RWStreamType valueType 
)
pure virtual

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.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual bool RWObjectInputStreamImp::startMember ( RWSymbol memberName,
RWStreamType memberType 
)
pure virtual

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 (returning true), then parameter memberName will contain the name of the member. Otherwise returns false.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

virtual void RWObjectInputStreamImp::startParent ( const RWSymbol )
inlinevirtual

Inputs tokens that identify the start of a parent class.

virtual RWSymbol RWObjectInputStreamImp::startSequence ( int &  count,
RWStreamType elementType 
)
pure virtual

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.

Implemented in RWXmlObjectInputStreamImp, RWEnhancedXmlObjectInputStreamImp, and RWCompactObjectInputStreamImp.

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