#include <coherence/io/pof/UserTypeReader.hpp>
Inherits PofBufferReader.
The "contextual awareness" refers to the fact that the UserTypeReader maintains state about the type identifier and version of the user type, the parser's property index position within the user type value, and a PofContext that may differ from the PofContext that provided the PofSerializer which is using this UserTypeReader to parse a user type.
Public Types | ||||||||||
typedef spec::Handle | Handle | |||||||||
UserTypeReader Handle definition. | ||||||||||
typedef spec::View | View | |||||||||
UserTypeReader View definition. | ||||||||||
typedef spec::Holder | Holder | |||||||||
UserTypeReader Holder definition. | ||||||||||
Public Member Functions | ||||||||||
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 void | registerIdentity (Object::Holder oh) | |||||||||
Register an identity for a newly created user type instance. If identity/reference types are enabled, an identity is used to uniquely identify a user type instance within a POF stream. The identity immediately proceeds the instance value in the POF stream and can be used later in the stream to reference the instance. PofSerializer implementations must call this method with the user type instance instantiated during deserialization prior to reading any properties of the instance which are user type instances themselves.
| ||||||||||
virtual PofReader::Handle | createNestedPofReader (int32_t iProp) | |||||||||
Obtain a PofReader that can be used to read a set of properties from a single property of the current user type. The returned PofReader is only valid from the time that it is returned until the next call is made to this PofReader.
| ||||||||||
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
| ||||||||||
virtual int32_t | getNextPropertyIndex () | |||||||||
Return the index of the next property in the POF stream. | ||||||||||
virtual int32_t | getPreviousPropertyIndex () const | |||||||||
Return the index of the most recent property read or (if it were missing) requested. | ||||||||||
Protected Member Functions | ||||||||||
UserTypeReader (ReadBuffer::BufferInput::Handle hIn, PofContext::View vCtx, int32_t nTypeId, int32_t nVersionId) | ||||||||||
Construct a parser for parsing the property values of a user type. | ||||||||||
UserTypeReader (PofBufferReader::Handle hParent, ReadBuffer::BufferInput::Handle hIn, PofContext::View vCtx, int32_t nTypeId, int32_t nVersionId) | ||||||||||
Construct a parser for parsing the property values of a user type. | ||||||||||
virtual bool | advanceTo (int32_t iProp) | |||||||||
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.
| ||||||||||
virtual void | complete (int32_t iProp) | |||||||||
Register the completion of the parsing of a value.
| ||||||||||
virtual void | closeNested () | |||||||||
Notify the UserTypeReader that it is being "closed". | ||||||||||
virtual PofBufferReader::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 PofBufferReader::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.
| ||||||||||
Protected Attributes | ||||||||||
FinalHandle < PofBufferReader > | f_hParent | |||||||||
The parent (ie containing) PofBufferReader. | ||||||||||
int32_t | m_nTypeId | |||||||||
The type identifier of the user type that is being parsed. | ||||||||||
int32_t | m_nVersionId | |||||||||
The version identifier of the user type that is being parsed. | ||||||||||
int32_t | m_iPrevProp | |||||||||
Most recent property read or (if it were missing) requested. | ||||||||||
int32_t | m_iNextProp | |||||||||
The index of the next property in the POF stream. | ||||||||||
size32_t | m_ofNextProp | |||||||||
The offset of the index of the next property to read. | ||||||||||
MemberHandle < UserTypeReader > | m_hReaderNested | |||||||||
The currently open nested reader, if any. | ||||||||||
int32_t | m_iNestedProp | |||||||||
The property index of the property from which the currently open nested reader is reading from. |
UserTypeReader | ( | ReadBuffer::BufferInput::Handle | hIn, | |
PofContext::View | vCtx, | |||
int32_t | nTypeId, | |||
int32_t | nVersionId | |||
) | [protected] |
Construct a parser for parsing the property values of a user type.
hIn | the BufferInput that contains the user type data, except for the user type id itself (which is passed passed as a constructor argument) | |
vCtx | the PofContext to use for parsing the user type property values within the user type that this parser will be parsing | |
nTypeId | the type id of the user type | |
nVersionId | the version id of the user type |
IOException | if an I/O error occurs |
UserTypeReader | ( | PofBufferReader::Handle | hParent, | |
ReadBuffer::BufferInput::Handle | hIn, | |||
PofContext::View | vCtx, | |||
int32_t | nTypeId, | |||
int32_t | nVersionId | |||
) | [protected] |
Construct a parser for parsing the property values of a user type.
hParent | the parent (ie the containing) PofBufferReader | |
hIn | the BufferInput that contains the user type data, except for the user type id itself (which is passed passed as a constructor argument) | |
vCtx | the PofContext to use for parsing the user type property values within the user type that this parser will be parsing | |
nTypeId | the type id of the user type | |
nVersionId | the version id of the user type |
IOException | if an I/O error occurs |
virtual int32_t getNextPropertyIndex | ( | ) | [virtual] |
Return the index of the next property in the POF stream.
IOException | if an I/O error occurs |
virtual int32_t getPreviousPropertyIndex | ( | ) | const [virtual] |
Return the index of the most recent property read or (if it were missing) requested.
virtual void closeNested | ( | ) | [protected, virtual] |
int32_t m_iPrevProp [protected] |
Most recent property read or (if it were missing) requested.
This is used to determine if the client is attempting to read properties in the wrong order.