#include <coherence/io/pof/PofBufferWriter.hpp>
Inherits PofHelper, and PofWriter.
Inherited by UserTypeWriter.
Public Types | |||||||||||||||||||||||||
typedef spec::Handle | Handle | ||||||||||||||||||||||||
PofBufferWriter Handle definition. | |||||||||||||||||||||||||
typedef spec::View | View | ||||||||||||||||||||||||
PofBufferWriter View definition. | |||||||||||||||||||||||||
typedef spec::Holder | Holder | ||||||||||||||||||||||||
PofBufferWriter Holder definition. | |||||||||||||||||||||||||
Public Member Functions | |||||||||||||||||||||||||
virtual void | writeBoolean (int32_t iProp, bool f) | ||||||||||||||||||||||||
Write a boolean property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeOctet (int32_t iProp, octet_t b) | ||||||||||||||||||||||||
Write an octet property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeChar16 (int32_t iProp, char16_t ch) | ||||||||||||||||||||||||
Write a 16-bit Unicode character property (represented as a char16_t ) to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt16 (int32_t iProp, int16_t n) | ||||||||||||||||||||||||
Write a 16-bit integer property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt32 (int32_t iProp, int32_t n) | ||||||||||||||||||||||||
Write a 32-bit integer property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt64 (int32_t iProp, int64_t l) | ||||||||||||||||||||||||
Write a 64-bit integer property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeFloat32 (int32_t iProp, float32_t fl) | ||||||||||||||||||||||||
Write a 32-bit floating-point property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeFloat64 (int32_t iProp, float64_t dfl) | ||||||||||||||||||||||||
Write a 64-bit floating-point property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeBooleanArray (int32_t iProp, Array< bool >::View vaf) | ||||||||||||||||||||||||
Write a boolean array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeOctetArray (int32_t iProp, Array< octet_t >::View vab) | ||||||||||||||||||||||||
Write an octect array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeChar16Array (int32_t iProp, Array< char16_t >::View vach) | ||||||||||||||||||||||||
Write a 16-bit Unicode character array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt16Array (int32_t iProp, Array< int16_t >::View van) | ||||||||||||||||||||||||
Write a 16-bit integer array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt32Array (int32_t iProp, Array< int32_t >::View van) | ||||||||||||||||||||||||
Write a 32-bit integer array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeInt64Array (int32_t iProp, Array< int64_t >::View val) | ||||||||||||||||||||||||
Write a 64-bit integer array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeFloat32Array (int32_t iProp, Array< float32_t >::View vafl) | ||||||||||||||||||||||||
Write a 32-bit floating-point array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeFloat64Array (int32_t iProp, Array< float64_t >::View vadfl) | ||||||||||||||||||||||||
Write a 64-bit floating-point array property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeBinary (int32_t iProp, Binary::View vBin) | ||||||||||||||||||||||||
Write a Binary property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeString (int32_t iProp, String::View vs) | ||||||||||||||||||||||||
Write a String property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawDate (int32_t iProp, RawDate::View vDate) | ||||||||||||||||||||||||
Write a RawDate property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawDateTime (int32_t iProp, RawDateTime::View vdt) | ||||||||||||||||||||||||
Write a RawDateTime property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawDayTimeInterval (int32_t iProp, RawDayTimeInterval::View vInterval) | ||||||||||||||||||||||||
Write a RawDayTimeInterval property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawTime (int32_t iProp, RawTime::View vTime) | ||||||||||||||||||||||||
Write a RawTime property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawTimeInterval (int32_t iProp, RawTimeInterval::View vInterval) | ||||||||||||||||||||||||
Write a RawTimeInterval property to the POF stream.
| |||||||||||||||||||||||||
virtual void | writeRawYearMonthInterval (int32_t iProp, RawYearMonthInterval::View vInterval) | ||||||||||||||||||||||||
Write a RawYearMonthInterval property to the POF stream.
| |||||||||||||||||||||||||
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 void | writeObjectArray (int32_t iProp, ObjectArray::View va) | ||||||||||||||||||||||||
Write an ObjectArray property to the POF stream.Each element of the given array must be an instance (or a collection of instances) of one of the following:
Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter.
| |||||||||||||||||||||||||
virtual void | writeObjectArray (int32_t iProp, ObjectArray::View va, Class::View vClass) | ||||||||||||||||||||||||
Write a uniform ObjectArray property to the POF stream.Each element of the given array must be an instance (or a collection of instances) of one of the following:
Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter. Additionally, the type of each element must be equal to the specified class.
| |||||||||||||||||||||||||
virtual void | writeLongArray (int32_t iProp, LongArray::View vla) | ||||||||||||||||||||||||
Write a LongArray property to the POF stream.Each element of the given array must be an instance (or a collection of instances) of one of the following:
Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter.
| |||||||||||||||||||||||||
virtual void | writeLongArray (int32_t iProp, LongArray::View vla, Class::View vClass) | ||||||||||||||||||||||||
Write a uniform LongArray property to the POF stream.Each element of the given array must be an instance (or a collection of instances) of one of the following:
Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter. Additionally, the type of each element must be equal to the specified class.
| |||||||||||||||||||||||||
virtual void | writeCollection (int32_t iProp, Collection::View vCol) | ||||||||||||||||||||||||
Write a Collection property to the POF stream.
Each element of the given
Otherwise, a PofSerializer for each element of the
| |||||||||||||||||||||||||
virtual void | writeCollection (int32_t iProp, Collection::View vCol, Class::View vClass) | ||||||||||||||||||||||||
Write a uniform Collection property to the POF stream.
Each element of the given
Otherwise, a PofSerializer for each element of the Additionally, the type of each element must be equal to the specified class.
| |||||||||||||||||||||||||
virtual void | writeMap (int32_t iProp, Map::View vMap) | ||||||||||||||||||||||||
Write a Map property to the POF stream.
Each key and value of the given
Otherwise, a PofSerializer for each key and value of the
| |||||||||||||||||||||||||
virtual void | writeMap (int32_t iProp, Map::View vMap, Class::View vClassKey) | ||||||||||||||||||||||||
Write a uniform key Map property to the POF stream.
Each key and value of the given
Otherwise, a PofSerializer for each key and value of the Additionally, the type of each key must be equal to the specified class.
| |||||||||||||||||||||||||
virtual void | writeMap (int32_t iProp, Map::View vMap, Class::View vClassKey, Class::View vClassValue) | ||||||||||||||||||||||||
Write a uniform Map property to the POF stream.
Each key and value of the given
Otherwise, a PofSerializer for each key and value of the Additionally, the type of each key must be equal to the specified class.
| |||||||||||||||||||||||||
virtual PofContext::View | getPofContext () const | ||||||||||||||||||||||||
Return the PofContext object used by this PofWriter to serialize user types to a POF stream.
| |||||||||||||||||||||||||
virtual void | setPofContext (PofContext::View vCtx) | ||||||||||||||||||||||||
Configure the PofContext object used by this PofWriter to serialize user types to 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 = hWriter->getPofContext();
// switch to another PofContext PofContext::View vCtxNew = ...; hWriter->setContext(vCtxNew);
// output POF data using the writer ...
// restore the original PofContext hWriter->setPofContext(vCtxOrig);
| |||||||||||||||||||||||||
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 | |||||||||||||||||||||||||
PofBufferWriter (WriteBuffer::BufferOutput::Handle hOut, PofContext::View vCtx) | |||||||||||||||||||||||||
Construct a new PofBufferWriter that will write a POF stream to the passed BufferOutput object. | |||||||||||||||||||||||||
PofBufferWriter (WritingPofHandler::Handle hHandler, PofContext::View vCtx) | |||||||||||||||||||||||||
Construct a new PofBufferWriter that will write a POF stream using the passed WritingPofHandler. | |||||||||||||||||||||||||
virtual void | beginProperty (int32_t iProp) | ||||||||||||||||||||||||
Report that a POF property is about to be written to the POF stream. | |||||||||||||||||||||||||
virtual void | endProperty (int32_t iProp) | ||||||||||||||||||||||||
Signifies the termination of the current POF property. | |||||||||||||||||||||||||
virtual WriteBuffer::BufferOutput::Handle | getBufferOutput () | ||||||||||||||||||||||||
Return the BufferOutput that this PofBufferWriter writes to. | |||||||||||||||||||||||||
virtual WriteBuffer::BufferOutput::View | getBufferOutput () const | ||||||||||||||||||||||||
Return the BufferOutput that this PofBufferWriter writes to. | |||||||||||||||||||||||||
virtual WritingPofHandler::Handle | getPofHandler () | ||||||||||||||||||||||||
Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream. | |||||||||||||||||||||||||
virtual WritingPofHandler::View | getPofHandler () const | ||||||||||||||||||||||||
Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream. | |||||||||||||||||||||||||
Static Protected Member Functions | |||||||||||||||||||||||||
static void | assertEqual (Class::View vClass, Class::View vClassTest) | ||||||||||||||||||||||||
Assert that a class is equal to another class. | |||||||||||||||||||||||||
Protected Attributes | |||||||||||||||||||||||||
FinalHandle < WriteBuffer::BufferOutput > | m_hOut | ||||||||||||||||||||||||
The BufferOutput object that the PofBufferWriter writes to. | |||||||||||||||||||||||||
MemberView< PofContext > | m_vCtx | ||||||||||||||||||||||||
The PofContext used by this PofBufferWriter to serialize user types. | |||||||||||||||||||||||||
FinalHandle < WritingPofHandler > | m_hHandler | ||||||||||||||||||||||||
The WritingPofHandler used to write a POF stream. |
PofBufferWriter | ( | WriteBuffer::BufferOutput::Handle | hOut, | |
PofContext::View | vCtx | |||
) | [protected] |
Construct a new PofBufferWriter that will write a POF stream to the passed BufferOutput object.
hOut | the BufferOutput object to write to; must not be NULL | |
vCtx | the PofContext used by the new PofBufferWriter to serialize user types; must not be NULL |
PofBufferWriter | ( | WritingPofHandler::Handle | hHandler, | |
PofContext::View | vCtx | |||
) | [protected] |
Construct a new PofBufferWriter that will write a POF stream using the passed WritingPofHandler.
hHandler | the WritingPofHandler used for writing; must not be NULL | |
vCtx | the PofContext used by the new PofBufferWriter to serialize user types; must not be NULL |
virtual void beginProperty | ( | int32_t | iProp | ) | [protected, virtual] |
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.
iProp | the index of the property being written |
IllegalArgumentException | if the property index is invalid, or is less than or equal to the index of the previous property written to the POF stream | |
IOException | if an I/O error occurs |
Reimplemented in UserTypeWriter.
virtual void endProperty | ( | int32_t | iProp | ) | [protected, virtual] |
Signifies the termination of the current POF property.
iProp | the index of the current property |
Reimplemented in UserTypeWriter.
static void assertEqual | ( | Class::View | vClass, | |
Class::View | vClassTest | |||
) | [static, protected] |
Assert that a class is equal to another class.
vClass | the expected class; must not be NULL | |
vClassTest | the class to test for equality; must not be NULL |
IllegalStateException | if the second class is not equal to the first |
virtual WriteBuffer::BufferOutput::Handle getBufferOutput | ( | ) | [protected, virtual] |
virtual WriteBuffer::BufferOutput::View getBufferOutput | ( | ) | const [protected, virtual] |
virtual WritingPofHandler::Handle getPofHandler | ( | ) | [protected, virtual] |
Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.
virtual WritingPofHandler::View getPofHandler | ( | ) | const [protected, virtual] |
Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.