#include <coherence/io/pof/UserTypeWriter.hpp>
Inherits PofBufferWriter.
The "contextual awareness" refers to the fact that the UserTypeWriter maintains state about the type identifier, the PofWriter'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 UserTypeWriter to serialize a user type.
Public Types | ||||||||||||||||
typedef spec::Handle | Handle | |||||||||||||||
UserTypeWriter Handle definition. | ||||||||||||||||
typedef spec::View | View | |||||||||||||||
UserTypeWriter View definition. | ||||||||||||||||
typedef spec::Holder | Holder | |||||||||||||||
UserTypeWriter Holder definition. | ||||||||||||||||
Public Member Functions | ||||||||||||||||
UserTypeWriter (WriteBuffer::BufferOutput::Handle hOut, PofContext::View vCtx, int32_t nTypeId, int32_t iProp) | ||||||||||||||||
Construct a UserTypeWriter for writing the property values of a user type. | ||||||||||||||||
UserTypeWriter (WritingPofHandler::Handle hHandler, PofContext::View vCtx, int32_t nTypeId, int32_t iProp) | ||||||||||||||||
Construct a UserTypeWriter for writing the property values of a user type. | ||||||||||||||||
virtual void | writeObject (int32_t iProp, Object::View v) | |||||||||||||||
Write an Object property to the POF stream.The given object must be an instance of one of the following:
Otherwise, a PofSerializer for the object must be obtainable from the PofContext associated with this PofWriter.
| ||||||||||||||||
virtual int32_t | getUserTypeId () const | |||||||||||||||
Determine the user type that is currently being written.
| ||||||||||||||||
virtual int32_t | getVersionId () const | |||||||||||||||
Determine the version identifier of the user type that is currently being written.
| ||||||||||||||||
virtual void | setVersionId (int32_t nVersionId) | |||||||||||||||
Set the version identifier of the user type that is currently being written.
| ||||||||||||||||
virtual void | writeRemainder (Binary::View vBinProps) | |||||||||||||||
Write the remaining properties to the POF stream, terminating the writing of the currrent user type. As part of writing out a user type, this method must be called by the PofSerializer that is writing out the user type, or the POF stream will be corrupted.
Calling this method terminates the current user type by writing a -1 to the POF stream after the last indexed property. Subsequent calls to the various
| ||||||||||||||||
Protected Member Functions | ||||||||||||||||
virtual void | beginProperty (int32_t iProp) | |||||||||||||||
Report that a POF property is about to be written to the POF stream. This method call will be followed by one or more separate calls to a "write" method and the property extent will then be terminated by a call to endProperty.
| ||||||||||||||||
virtual void | endProperty (int32_t iProp) | |||||||||||||||
Signifies the termination of the current POF property.
| ||||||||||||||||
virtual void | writeUserTypeInfo () | |||||||||||||||
Write out the type and version identifiers of the user type to the POF stream, if they haven't already been written. | ||||||||||||||||
Protected Attributes | ||||||||||||||||
const int32_t | m_nTypeId | |||||||||||||||
The type identifier of the user type that is being written. | ||||||||||||||||
int32_t | m_nVersionId | |||||||||||||||
The version identifier of the user type that is being written. | ||||||||||||||||
const int32_t | m_iProp | |||||||||||||||
The index of the user type being written. | ||||||||||||||||
int32_t | m_iPrevProp | |||||||||||||||
The index of the last property written to the POF stream or -1 if the first property has yet to be written. | ||||||||||||||||
bool | m_fUserTypeBegin | |||||||||||||||
True iff the type and version identifier of the user type was written to the POF stream. | ||||||||||||||||
bool | m_fUserTypeEnd | |||||||||||||||
True iff the user type was written to the POF stream. | ||||||||||||||||
MemberHandle < WritingPofHandler::Complex > | m_hComplex | |||||||||||||||
The Complex value that corresponds to the user type that is being written. |
UserTypeWriter | ( | WriteBuffer::BufferOutput::Handle | hOut, | |
PofContext::View | vCtx, | |||
int32_t | nTypeId, | |||
int32_t | iProp | |||
) |
Construct a UserTypeWriter for writing the property values of a user type.
hOut | the BufferOutput object to write to; must not be NULL | |
vCtx | the PofContext to use for writing the user type property values within the user type that this writer will be writing | |
nTypeId | the type identifier of the user type; must be non-negative | |
iProp | the index of the user type being written |
UserTypeWriter | ( | WritingPofHandler::Handle | hHandler, | |
PofContext::View | vCtx, | |||
int32_t | nTypeId, | |||
int32_t | iProp | |||
) |
Construct a UserTypeWriter for writing the property values of a user type.
hHandler | the WritingPofHandler used to write user type data (except for the user type id itself, which is passed as a constructor argument) | |
vCtx | the PofContext to use for writing the user type property values within the user type that this writer will be writing | |
nTypeId | the type identifier of the user type; must be non-negative | |
iProp | the index of the user type being written |
virtual void writeUserTypeInfo | ( | ) | [protected, virtual] |
Write out the type and version identifiers of the user type to the POF stream, if they haven't already been written.
IOException | on I/O error |