#include <coherence/io/pof/WritingPofHandler.hpp>
Inherits PofHelper, and PofHandler.
Public Types | |||||||||||||||||||||||||||||||
typedef spec::Handle | Handle | ||||||||||||||||||||||||||||||
WritingPofHandler Handle definition. | |||||||||||||||||||||||||||||||
typedef spec::View | View | ||||||||||||||||||||||||||||||
WritingPofHandler View definition. | |||||||||||||||||||||||||||||||
typedef spec::Holder | Holder | ||||||||||||||||||||||||||||||
WritingPofHandler Holder definition. | |||||||||||||||||||||||||||||||
Public Member Functions | |||||||||||||||||||||||||||||||
virtual void | registerIdentity (int32_t nId) | ||||||||||||||||||||||||||||||
This method is invoked when an identity is encountered in the POF stream. The identity is used to uniquely identify the next value in the POF stream, and can be later referenced by the onIdentityReference method.
| |||||||||||||||||||||||||||||||
virtual void | onNullReference (int32_t iPos) | ||||||||||||||||||||||||||||||
Specifies that a NULL value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onIdentityReference (int32_t iPos, int32_t nId) | ||||||||||||||||||||||||||||||
Specifies that a reference to a previously-identified value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onInt16 (int32_t iPos, int16_t n) | ||||||||||||||||||||||||||||||
Report that a short integer value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onInt32 (int32_t iPos, int32_t n) | ||||||||||||||||||||||||||||||
Report that an integer value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onInt64 (int32_t iPos, int64_t n) | ||||||||||||||||||||||||||||||
Report that a long integer value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onFloat32 (int32_t iPos, float32_t fl) | ||||||||||||||||||||||||||||||
Report that a base-2 single-precision floating-point value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onFloat64 (int32_t iPos, float64_t dfl) | ||||||||||||||||||||||||||||||
Report that a base-2 double-precision floating-point value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onBoolean (int32_t iPos, bool f) | ||||||||||||||||||||||||||||||
Report that a boolean value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onOctet (int32_t iPos, octet_t b) | ||||||||||||||||||||||||||||||
Report that an octet value (a byte) has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onOctetString (int32_t iPos, Binary::View vBin) | ||||||||||||||||||||||||||||||
Report that a octet string value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onChar (int32_t iPos, char16_t ch) | ||||||||||||||||||||||||||||||
Report that a character value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onCharString (int32_t iPos, String::View vs) | ||||||||||||||||||||||||||||||
Report that a character string value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onDate (int32_t iPos, int32_t nYear, int32_t nMonth, int32_t nDay) | ||||||||||||||||||||||||||||||
Report that a date value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onYearMonthInterval (int32_t iPos, int32_t cYears, int32_t cMonths) | ||||||||||||||||||||||||||||||
Report that a year-month interval value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onTime (int32_t iPos, int32_t nHour, int32_t nMinute, int32_t nSecond, int32_t nNano, bool fUTC) | ||||||||||||||||||||||||||||||
Report that a time value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onTime (int32_t iPos, int32_t nHour, int32_t nMinute, int32_t nSecond, int32_t nNano, int32_t nHourOffset, int32_t nMinuteOffset) | ||||||||||||||||||||||||||||||
Report that a time value (with a timezone offset) has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onTimeInterval (int32_t iPos, int32_t cHours, int32_t cMinutes, int32_t cSeconds, int32_t cNanos) | ||||||||||||||||||||||||||||||
Report that a time interval value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onDateTime (int32_t iPos, int32_t nYear, int32_t nMonth, int32_t nDay, int32_t nHour, int32_t nMinute, int32_t nSecond, int32_t nNano, bool fUTC) | ||||||||||||||||||||||||||||||
Report that a date-time value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onDateTime (int32_t iPos, int32_t nYear, int32_t nMonth, int32_t nDay, int32_t nHour, int32_t nMinute, int32_t nSecond, int32_t nNano, int32_t nHourOffset, int32_t nMinuteOffset) | ||||||||||||||||||||||||||||||
Report that a date-time value (with a timezone offset) has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | onDayTimeInterval (int32_t iPos, int32_t cDays, int32_t cHours, int32_t cMinutes, int32_t cSeconds, int32_t cNanos) | ||||||||||||||||||||||||||||||
Report that a day-time interval value has been encountered in the POF stream.
| |||||||||||||||||||||||||||||||
virtual void | beginCollection (int32_t iPos, size32_t cElements) | ||||||||||||||||||||||||||||||
Report that a collection of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginUniformCollection (int32_t iPos, size32_t cElements, int32_t nType) | ||||||||||||||||||||||||||||||
Report that a uniform collection of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginArray (int32_t iPos, size32_t cElements) | ||||||||||||||||||||||||||||||
Report that an array of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginUniformArray (int32_t iPos, size32_t cElements, int32_t nType) | ||||||||||||||||||||||||||||||
Report that a uniform array of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginSparseArray (int32_t iPos, size32_t cElements) | ||||||||||||||||||||||||||||||
Report that a sparse array of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for present element in the sparse array (up to
| |||||||||||||||||||||||||||||||
virtual void | beginUniformSparseArray (int32_t iPos, size32_t cElements, int32_t nType) | ||||||||||||||||||||||||||||||
Report that a uniform sparse array of values has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for present element in the sparse array (up to
| |||||||||||||||||||||||||||||||
virtual void | beginMap (int32_t iPos, size32_t cElements) | ||||||||||||||||||||||||||||||
Report that a map of key/value pairs has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginUniformKeysMap (int32_t iPos, size32_t cElements, int32_t nTypeKeys) | ||||||||||||||||||||||||||||||
Report that a map of key/value pairs (with the keys being of a uniform type) has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginUniformMap (int32_t iPos, size32_t cElements, int32_t nTypeKeys, int32_t nTypeValues) | ||||||||||||||||||||||||||||||
Report that a map of key/value pairs (with the keys being of a uniform type and the values being of a uniform type) has been encountered in the POF stream.
This method call will be followed by a separate call to an "on" or "begin" method for each of the
| |||||||||||||||||||||||||||||||
virtual void | beginUserType (int32_t iPos, int32_t nUserTypeId, int32_t nVersionId) | ||||||||||||||||||||||||||||||
Report that a value of a "user type" has been encountered in the POF stream. A user type is analogous to a "class", and a value of a user type is analogous to an "object". This method call will be followed by a separate call to an "on" or "begin" method for each of the property values in the user type, and the user type will then be terminated by a call to endComplexValue().
| |||||||||||||||||||||||||||||||
virtual void | endComplexValue () | ||||||||||||||||||||||||||||||
Signifies the termination of the current complex value.
Complex values are any of the collection, array, map and user types. For each call to one of the "begin" methods, there will be a corresponding call to this method, even if there were no contents in the complex value. | |||||||||||||||||||||||||||||||
virtual WriteBuffer::BufferOutput::Handle | getBufferOutput () | ||||||||||||||||||||||||||||||
Obtain the DataOutput object that this Writing POF Handler is writing to. | |||||||||||||||||||||||||||||||
virtual WriteBuffer::BufferOutput::View | getBufferOutput () const | ||||||||||||||||||||||||||||||
Obtain the DataOutput object that this Writing POF Handler is writing to. | |||||||||||||||||||||||||||||||
virtual Complex::Handle | getComplex () | ||||||||||||||||||||||||||||||
Obtain the current Complex object that represents the complex type that is being written to the POF stream. | |||||||||||||||||||||||||||||||
virtual Complex::View | getComplex () const | ||||||||||||||||||||||||||||||
Obtain the current Complex object that represents the complex type that is being written to the POF stream. | |||||||||||||||||||||||||||||||
Protected Member Functions | |||||||||||||||||||||||||||||||
WritingPofHandler (WriteBuffer::BufferOutput::Handle hOut) | |||||||||||||||||||||||||||||||
Construct a Writing POF Handler that will write a POF stream to the passed BufferOutput object. | |||||||||||||||||||||||||||||||
virtual bool | isSkippable () const | ||||||||||||||||||||||||||||||
Determine if the value encoding can be skipped. | |||||||||||||||||||||||||||||||
virtual bool | isCompressable () const | ||||||||||||||||||||||||||||||
Determine if the value encoding can be compressed by combining type and value information in such a way that type information could be lost. | |||||||||||||||||||||||||||||||
virtual void | encodePosition (int32_t iPos) | ||||||||||||||||||||||||||||||
Called for each and every value going into the POF stream, in case the value needs its position to be encoded into the stream. | |||||||||||||||||||||||||||||||
virtual bool | isTypeIdEncoded (int32_t nTypeId) const | ||||||||||||||||||||||||||||||
Determine if the type should be encoded for the current value. | |||||||||||||||||||||||||||||||
Protected Attributes | |||||||||||||||||||||||||||||||
FinalHandle < WriteBuffer::BufferOutput > | m_hOut | ||||||||||||||||||||||||||||||
The BufferOutput to write to. | |||||||||||||||||||||||||||||||
MemberHandle< Complex > | m_hComplex | ||||||||||||||||||||||||||||||
The current containing Complex value in the POF stream. | |||||||||||||||||||||||||||||||
bool | m_fHasIdentity | ||||||||||||||||||||||||||||||
Set to true when the next value to write has been tagged with an identity. | |||||||||||||||||||||||||||||||
Classes | |||||||||||||||||||||||||||||||
class | Complex | ||||||||||||||||||||||||||||||
A Complex object represents the current complex data structure in the POF stream. More... | |||||||||||||||||||||||||||||||
class | ComplexMap | ||||||||||||||||||||||||||||||
A ComplexMap object represents a map data structure (with uniform keys or with uniform keys and values) in the POF stream. More... |
WritingPofHandler | ( | WriteBuffer::BufferOutput::Handle | hOut | ) | [protected] |
Construct a Writing POF Handler that will write a POF stream to the passed BufferOutput object.
hOut | the BufferOutput to write to |
virtual bool isSkippable | ( | ) | const [protected, virtual] |
Determine if the value encoding can be skipped.
A value can be skipped if it is a default value and if it does not have an identity and if it is in a sparse data structure.
virtual bool isCompressable | ( | ) | const [protected, virtual] |
Determine if the value encoding can be compressed by combining type and value information in such a way that type information could be lost.
virtual void encodePosition | ( | int32_t | iPos | ) | [protected, virtual] |
Called for each and every value going into the POF stream, in case the value needs its position to be encoded into the stream.
iPos | the position (property index, array index, etc.) |
virtual bool isTypeIdEncoded | ( | int32_t | nTypeId | ) | const [protected, virtual] |
Determine if the type should be encoded for the current value.
nTypeId | the type of the current value |
virtual WriteBuffer::BufferOutput::Handle getBufferOutput | ( | ) | [virtual] |
Obtain the DataOutput object that this Writing POF Handler is writing to.
virtual WriteBuffer::BufferOutput::View getBufferOutput | ( | ) | const [virtual] |
Obtain the DataOutput object that this Writing POF Handler is writing to.
virtual Complex::Handle getComplex | ( | ) | [virtual] |
virtual Complex::View getComplex | ( | ) | const [virtual] |