#include <coherence/io/pof/PofBufferReader.hpp>
Inherits PofHelper, and PofReader.
Inherited by UserTypeReader.
Public Types | |||||||||||||
typedef spec::Handle | Handle | ||||||||||||
PofBufferReader Handle definition. | |||||||||||||
typedef spec::View | View | ||||||||||||
PofBufferReader View definition. | |||||||||||||
typedef spec::Holder | Holder | ||||||||||||
PofBufferReader Holder definition. | |||||||||||||
Public Member Functions | |||||||||||||
virtual bool | readBoolean (int32_t iProp) | ||||||||||||
Read a boolean property from the POF stream.
| |||||||||||||
virtual octet_t | readOctet (int32_t iProp) | ||||||||||||
Read an octet property from the POF stream.
| |||||||||||||
virtual char16_t | readChar16 (int32_t iProp) | ||||||||||||
Read a 16-bit Unicode character property from the POF stream.
| |||||||||||||
virtual int16_t | readInt16 (int32_t iProp) | ||||||||||||
Read a 16-bit integer property from the POF stream.
| |||||||||||||
virtual int32_t | readInt32 (int32_t iProp) | ||||||||||||
Read a 32-bit integer property from the POF stream.
| |||||||||||||
virtual int64_t | readInt64 (int32_t iProp) | ||||||||||||
Read a 64-bit integer property from the POF stream.
| |||||||||||||
virtual float32_t | readFloat32 (int32_t iProp) | ||||||||||||
Read a a 32-bit floating-point property from the POF stream.
| |||||||||||||
virtual float64_t | readFloat64 (int32_t iProp) | ||||||||||||
Read a 64-bit floating-point property from the POF stream.
| |||||||||||||
virtual Array< bool > ::Handle | readBooleanArray (int32_t iProp) | ||||||||||||
Read a boolean array property from the POF stream.
| |||||||||||||
virtual Array < octet_t >::Handle | readOctetArray (int32_t iProp) | ||||||||||||
Read an octet array property from the POF stream.
| |||||||||||||
virtual Array < char16_t >::Handle | readChar16Array (int32_t iProp) | ||||||||||||
Read a 16-bit Unicode character array property from the POF stream.
| |||||||||||||
virtual Array < int16_t >::Handle | readInt16Array (int32_t iProp) | ||||||||||||
Read a 16-bit integer array property from the POF stream.
| |||||||||||||
virtual Array < int32_t >::Handle | readInt32Array (int32_t iProp) | ||||||||||||
Read a 32-bit integer array property from the POF stream.
| |||||||||||||
virtual Array < int64_t >::Handle | readInt64Array (int32_t iProp) | ||||||||||||
Read a 64-bit integer array property from the POF stream.
| |||||||||||||
virtual Array < float32_t > ::Handle | readFloat32Array (int32_t iProp) | ||||||||||||
Read a a 32-bit floating-point array property from the POF stream.
| |||||||||||||
virtual Array < float64_t > ::Handle | readFloat64Array (int32_t iProp) | ||||||||||||
Read a a 64-bit floating-point array property from the POF stream.
| |||||||||||||
virtual Binary::View | readBinary (int32_t iProp) | ||||||||||||
Read a Binary property from the POF stream.
| |||||||||||||
virtual String::View | readString (int32_t iProp) | ||||||||||||
Read a String property from the POF stream.
| |||||||||||||
virtual RawDate::View | readRawDate (int32_t iProp) | ||||||||||||
Read a RawDate property from the POF stream.
| |||||||||||||
virtual RawTime::View | readRawTime (int32_t iProp) | ||||||||||||
Read a RawTime property from the POF stream.
| |||||||||||||
virtual RawDateTime::View | readRawDateTime (int32_t iProp) | ||||||||||||
Read a RawDateTime property from the POF stream.
| |||||||||||||
virtual RawYearMonthInterval::View | readRawYearMonthInterval (int32_t iProp) | ||||||||||||
Read a RawYearMonthInterval property from the POF stream.
| |||||||||||||
virtual RawTimeInterval::View | readRawTimeInterval (int32_t iProp) | ||||||||||||
Read a RawTimeInterval property from the POF stream.
| |||||||||||||
virtual RawDayTimeInterval::View | readRawDayTimeInterval (int32_t iProp) | ||||||||||||
Read a RawDayTimeInterval property from the POF stream.
| |||||||||||||
virtual Object::Holder | readObject (int32_t iProp) | ||||||||||||
Read a property of any type, including a user type, from the POF stream.
| |||||||||||||
virtual ObjectArray::Handle | readObjectArray (int32_t iProp) | ||||||||||||
Read an ObjectArray property from the POF stream.
| |||||||||||||
virtual LongArray::View | readLongArray (int32_t iProp, LongArray::Handle hla=NULL) | ||||||||||||
Read a LongArray of object values from the POF stream.
| |||||||||||||
virtual Collection::View | readCollection (int32_t iProp, Collection::Handle hCol=NULL) | ||||||||||||
Read a Collection of object values from the POF stream.
| |||||||||||||
virtual Map::View | readMap (int32_t iProp, Map::Handle hMap=NULL) | ||||||||||||
Read a Map of key/value pairs from the POF stream.
| |||||||||||||
virtual PofContext::View | getPofContext () const | ||||||||||||
Return the PofContext object used by this PofReader to deserialize user types from a POF stream.
| |||||||||||||
virtual void | setPofContext (PofContext::View vCtx) | ||||||||||||
Configure the PofContext object used by this PofReader to deserialize user types from a POF stream. Note: this is an advanced method that should be used with care. For example, if this method is being used to switch to another PofContext mid-POF stream, it is important to eventually restore the original PofContext. For example: PofContext::View vCtxOrig = hReader->getPofContext();
// switch to another PofContext PofContext::View vCtxNew = ...; hReader->setContext(vCtxNew);
// read POF data using the reader ...
// restore the original PofContext hReader->setPofContext(vCtxOrig);
| |||||||||||||
virtual int32_t | getUserTypeId () const | ||||||||||||
Determine the user type that is currently being parsed.
| |||||||||||||
virtual int32_t | getVersionId () const | ||||||||||||
Determine the version identifier of the user type that is currently being parsed.
| |||||||||||||
virtual Binary::View | readRemainder () | ||||||||||||
Read all remaining indexed properties of the current user type from the POF stream. As part of reading in a user type, this method must be called by the PofSerializer that is reading the user type, or the read position within the POF stream will be corrupted.
Subsequent calls to the various
| |||||||||||||
Protected Member Functions | |||||||||||||
PofBufferReader (ReadBuffer::BufferInput::Handle hIn, PofContext::View vCtx) | |||||||||||||
Construct a new PofBufferReader that will read a POF stream from the passed BufferInput object. | |||||||||||||
virtual bool | advanceTo (int32_t iProp) | ||||||||||||
Advance through the POF stream until the specified property is found. | |||||||||||||
virtual void | complete (int32_t iProp) | ||||||||||||
Register the completion of the parsing of a value. | |||||||||||||
virtual Handle | getParentParser () | ||||||||||||
If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type. | |||||||||||||
virtual View | getParentParser () const | ||||||||||||
If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type. | |||||||||||||
virtual LongArray::Handle | ensureReferenceRegistry () | ||||||||||||
Obtain the registry for identity-reference pairs, creating it if necessary. | |||||||||||||
virtual void | registerIdentity (int32_t nId, Object::Holder ohValue) | ||||||||||||
Register the passed value with the passed identity. | |||||||||||||
virtual Object::Holder | lookupIdentity (int32_t nId) | ||||||||||||
Look up the specified identity and return the object to which it refers. | |||||||||||||
virtual Object::Holder | readAsObject (int32_t nType) | ||||||||||||
Read a POF value as an Object. | |||||||||||||
virtual ObjectArray::Handle | readAsObjectArray (int32_t nType) | ||||||||||||
Read a POF value as an Object array. | |||||||||||||
Protected Attributes | |||||||||||||
MemberHandle < ReadBuffer::BufferInput > | m_hIn | ||||||||||||
The BufferInput containing the POF stream. | |||||||||||||
MemberView< PofContext > | m_vCtx | ||||||||||||
The PofContext to use to realize user data types as objects. | |||||||||||||
MemberHandle< LongArray > | m_hlaRefs | ||||||||||||
Lazily-constructed mapping of identities to references. |
PofBufferReader | ( | ReadBuffer::BufferInput::Handle | hIn, | |
PofContext::View | vCtx | |||
) | [protected] |
Construct a new PofBufferReader that will read a POF stream from the passed BufferInput object.
hIn | a BufferInput object | |
vCtx | the PofContext |
virtual bool advanceTo | ( | int32_t | iProp | ) | [protected, virtual] |
Advance through the POF stream until the specified property is found.
If the property is found, return true, otherwise return false and advance to the first property that follows the specified property.
iProp | the index of the property to advance to |
IllegalStateException | if the POF stream has already advanced past the desired property | |
IOException | if an I/O error occurs |
Reimplemented in UserTypeReader.
virtual void complete | ( | int32_t | iProp | ) | [protected, virtual] |
Register the completion of the parsing of a value.
iProp | the property index |
IOException | if an I/O error occurs |
Reimplemented in UserTypeReader.
virtual Handle getParentParser | ( | ) | [protected, virtual] |
If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type.
virtual View getParentParser | ( | ) | const [protected, virtual] |
If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type.
virtual LongArray::Handle ensureReferenceRegistry | ( | ) | [protected, virtual] |
Obtain the registry for identity-reference pairs, creating it if necessary.
virtual void registerIdentity | ( | int32_t | nId, | |
Object::Holder | ohValue | |||
) | [protected, virtual] |
Register the passed value with the passed identity.
nId | the identity | |
ohValue | the value to register |
IOException | if the specified identity is already registered |
virtual Object::Holder lookupIdentity | ( | int32_t | nId | ) | [protected, virtual] |
Look up the specified identity and return the object to which it refers.
nId | the identity |
IOException | if the requested identity is not registered |
virtual Object::Holder readAsObject | ( | int32_t | nType | ) | [protected, virtual] |
Read a POF value as an Object.
nType | the type identifier of the value |
IOException | if an I/O error occurs |
virtual ObjectArray::Handle readAsObjectArray | ( | int32_t | nType | ) | [protected, virtual] |
Read a POF value as an Object array.
nType | the type identifier of the value |
IOException | if an I/O error occurs |