Oracle Coherence for C++ API
Release 3.7.1.0

E22845-01

PofBufferWriter Class Reference

#include <coherence/io/pof/PofBufferWriter.hpp>

Inherits PofHelper, and PofWriter.

Inherited by UserTypeWriter.

List of all members.


Detailed Description

PofWriter implementation that writes POF-encoded data to a WriteBuffer::BufferOutput.

Author:
jh 2008.04.09
 

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.
Parameters:
  iProp  the property index
  f  the bool property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeOctet (int32_t iProp, octet_t b)
  Write an octet property to the POF stream.
Parameters:
  iProp  the property index
  b  the octet_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
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.
Parameters:
  iProp  the property index
  ch  the char16_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt16 (int32_t iProp, int16_t n)
  Write a 16-bit integer property to the POF stream.
Parameters:
  iProp  the property index
  n  the int16_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt32 (int32_t iProp, int32_t n)
  Write a 32-bit integer property to the POF stream.
Parameters:
  iProp  the property index
  n  the int32_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt64 (int32_t iProp, int64_t l)
  Write a 64-bit integer property to the POF stream.
Parameters:
  iProp  the property index
  l  the int64_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeFloat32 (int32_t iProp, float32_t fl)
  Write a 32-bit floating-point property to the POF stream.
Parameters:
  iProp  the property index
  fl  the float32_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeFloat64 (int32_t iProp, float64_t dfl)
  Write a 64-bit floating-point property to the POF stream.
Parameters:
  iProp  the property index
  dfl  the float64_t property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeBooleanArray (int32_t iProp, Array< bool >::View vaf)
  Write a boolean array property to the POF stream.
Parameters:
  iProp  the property index
  vaf  the bool array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeOctetArray (int32_t iProp, Array< octet_t >::View vab)
  Write an octect array property to the POF stream.
Parameters:
  iProp  the property index
  vab  the octet_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeChar16Array (int32_t iProp, Array< char16_t >::View vach)
  Write a 16-bit Unicode character array property to the POF stream.
Parameters:
  iProp  the property index
  vach  the char16_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt16Array (int32_t iProp, Array< int16_t >::View van)
  Write a 16-bit integer array property to the POF stream.
Parameters:
  iProp  the property index
  van  the int16_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt32Array (int32_t iProp, Array< int32_t >::View van)
  Write a 32-bit integer array property to the POF stream.
Parameters:
  iProp  the property index
  van  the int32_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeInt64Array (int32_t iProp, Array< int64_t >::View val)
  Write a 64-bit integer array property to the POF stream.
Parameters:
  iProp  the property index
  val  the int64_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeFloat32Array (int32_t iProp, Array< float32_t >::View vafl)
  Write a 32-bit floating-point array property to the POF stream.
Parameters:
  iProp  the property index
  vafl  the float32_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeFloat64Array (int32_t iProp, Array< float64_t >::View vadfl)
  Write a 64-bit floating-point array property to the POF stream.
Parameters:
  iProp  the property index
  vadfl  the float64_t array property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeBinary (int32_t iProp, Binary::View vBin)
  Write a Binary property to the POF stream.
Parameters:
  iProp  the property index
  vBin  the Binary property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeString (int32_t iProp, String::View vs)
  Write a String property to the POF stream.
Parameters:
  iProp  the property index
  vs  the String property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawDate (int32_t iProp, RawDate::View vDate)
  Write a RawDate property to the POF stream.
Parameters:
  iProp  the property index
  vDate  the RawDate property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawDateTime (int32_t iProp, RawDateTime::View vdt)
  Write a RawDateTime property to the POF stream.
Parameters:
  iProp  the property index
  vdt  the RawDateTime property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawDayTimeInterval (int32_t iProp, RawDayTimeInterval::View vInterval)
  Write a RawDayTimeInterval property to the POF stream.
Parameters:
  iProp  the property index
  vInterval  the RawDayTimeInterval property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawTime (int32_t iProp, RawTime::View vTime)
  Write a RawTime property to the POF stream.
Parameters:
  iProp  the property index
  vTime  the RawTime property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawTimeInterval (int32_t iProp, RawTimeInterval::View vInterval)
  Write a RawTimeInterval property to the POF stream.
Parameters:
  iProp  the property index
  vInterval  the RawTimeInterval property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
virtual void  writeRawYearMonthInterval (int32_t iProp, RawYearMonthInterval::View vInterval)
  Write a RawYearMonthInterval property to the POF stream.
Parameters:
  iProp  the property index
  vInterval  the RawYearMonthInterval property value to write
Exceptions:
  coherence::lang::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
  coherence::io::IOException  if an I/O error occurs
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:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for the object must be obtainable from the PofContext associated with this PofWriter.

Parameters:
  iProp  the property index
  v  the Object property to write
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::io::IOException  if an I/O error occurs
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:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter.

Parameters:
  iProp  the property index
  va  the ObjectArray property value to write
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::io::IOException  if an I/O error occurs
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:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

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.

Parameters:
  iProp  the property index
  va  the ObjectArray property value to write
  vClass  the class of all elements; must not be NULL
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::lang::IllegalArgumentException  if the type of one or more elements of the array is not equal to the specified class
  coherence::io::IOException  if an I/O error occurs
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:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each element of the array must be obtainable from the PofContext associated with this PofWriter.

Parameters:
  iProp  the property index
  vla  the LongArray property value to write
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::io::IOException  if an I/O error occurs
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:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

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.

Parameters:
  iProp  the property index
  vla  the LongArray property value to write
  vClass  the class of all elements; must not be NULL
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::lang::IllegalArgumentException  if the type of one or more elements of the array is not equal to the specified class
  coherence::io::IOException  if an I/O error occurs
virtual void  writeCollection (int32_t iProp, Collection::View vCol)
  Write a Collection property to the POF stream.

Each element of the given Collection must be an instance (or collection of instances) of one of the following:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each element of the Collection must be obtainable from the PofContext associated with this PofWriter.

Parameters:
  iProp  the property index
  vCol  the Collection property value to write
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::io::IOException  if an I/O error occurs
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 Collection must be an instance (or collection of instances) of one of the following:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each element of the Collection must be obtainable from the PofContext associated with this PofWriter.

Additionally, the type of each element must be equal to the specified class.

Parameters:
  iProp  the property index
  vCol  the Collection property value to write
  vClass  the class of all elements; must not be NULL
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::lang::IllegalArgumentException  if the type of one or more elements of the Collection is not equal to the specified class
  coherence::io::IOException  if an I/O error occurs
virtual void  writeMap (int32_t iProp, Map::View vMap)
  Write a Map property to the POF stream.

Each key and value of the given Map must be an instance (or a collection of instances) of one of the following:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each key and value of the Map must be obtainable from the PofContext associated with this PofWriter.

Parameters:
  iProp  the property index
  vMap  the Map property value to write
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::io::IOException  if an I/O error occurs
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 Map must be an instance (or a collection of instances) of one of the following:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each key and value of the Map must be obtainable from the PofContext associated with this PofWriter.

Additionally, the type of each key must be equal to the specified class.

Parameters:
  iProp  the property index
  vMap  the Map property value to write
  vClassKey  the class of all keys; must not be NULL
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::lang::IllegalArgumentException  if the type of one or more keys of the Map is not equal to the specified class
  coherence::io::IOException  if an I/O error occurs
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 Map must be an instance (or a collection of instances) of one of the following:

  • Boolean
  • Octet
  • Char16
  • Int16
  • Int32
  • Int64
  • Float32
  • Float64
  • Array<bool>
  • Array<octet_t>
  • Array<char16_t>
  • Array<int16_t>
  • Array<int32_t>
  • Array<int64_t>
  • Array<float32_t>
  • Array<float64_t>
  • Binary
  • String
  • RawDate
  • RawDateTime
  • RawDayTimeInterval
  • RawTime
  • RawTimeInterval
  • RawYearMonthInterval
  • Collection, with the same restrictions for all elements
  • LongArray, with the same restrictions for all elements
  • ObjectArray, with the same restrictions for all elements

Otherwise, a PofSerializer for each key and value of the Map must be obtainable from the PofContext associated with this PofWriter.

Additionally, the type of each key must be equal to the specified class.

Parameters:
  iProp  the property index
  vMap  the Map property value to write
  vClassKey  the class of all keys; must not be NULL
  vClassValue  the class of all values; must not be NULL
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalArgumentException  if the given property cannot be encoded into a POF stream
  coherence::lang::IllegalArgumentException  if the type of one or more keys or values of the Map is not equal to the specified classes
  coherence::io::IOException  if an I/O error occurs
virtual PofContext::View  getPofContext () const
  Return the PofContext object used by this PofWriter to serialize user types to a POF stream.
Returns:
the PofContext object that contains user type meta-data
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);
 
Parameters:
  vCtx  the new PofContext; must not be NULL
virtual int32_t  getUserTypeId () const
  Determine the user type that is currently being written.
Returns:
the user type identifier, or -1 if the PofWriter is not currently writing a user type
virtual int32_t  getVersionId () const
  Determine the version identifier of the user type that is currently being written.
Returns:
the integer version ID of the user type; always non-negative
Exceptions:
  coherence::lang::IllegalStateException  if no user type is being parsed
virtual void  setVersionId (int32_t nVersionId)
  Set the version identifier of the user type that is currently being written.
Parameters:
  nVersionId  the user type identifier; must be non-negative
Exceptions:
  coherence::lang::IllegalArgumentException  if the given version ID is negative
  coherence::lang::IllegalStateException  if no user type is being written
virtual PofWriter::Handle  createNestedPofWriter (int32_t iProp)
  Obtain a PofWriter that can be used to write a set of properties into a single property of the current user type.

The returned PofWriter is only valid from the time that it is returned until the next call is made to this PofWriter.

Parameters:
  iProp  the property index
Returns:
a PofWriter whose contents are nested into a single property of this PofWriter
Exceptions:
  coherence::lang::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
  coherence::lang::IllegalStateException  if no user type is being written
  coherence::io::IOException  if an I/O error occurs
Since:
Coherence 3.6
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 writeXYZ methods of this interface will fail after this method is called.

Parameters:
  vBinProps  a buffer that contains zero or more indexed properties in binary POF encoded form; may be NULL
Exceptions:
  coherence::lang::IllegalStateException  if no user type is being written
  coherence::io::IOException  if an I/O error occurs
virtual void  enableReference ()
  Ensure that references (support for cyclic dependencies) are enabled.
virtual bool  isReferenceEnabled ()
  Determine if reference support is enabled.

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  writeUserType (int32_t iProp, Object::View v)
  Write a property of user defined type to the POF stream.
virtual
PofBufferWriter::Handle 
getParentWriter ()
  If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.
virtual
PofBufferWriter::View 
getParentWriter () const
  If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.
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.
virtual bool  isEvolvable ()
  Determine if the object to be written is either Evolvable or part of an Evolvable object.
virtual void  setEvolvable (bool fEvolvable)
  Set the Evolvable flag to indicate if the object to be written is Evolvable or part of an Evolvable object.

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.
bool  m_fEvolvable
  Indicate if the object to be written is either Evolvable or part of an Evolvable object.
FinalHandle
< WritingPofHandler
m_hHandler
  The WritingPofHandler used to write a POF stream.
MemberHandle
< ReferenceLibrary
m_hRefs
  If references are used, then this is the ReferenceLibrary.

Constructor & Destructor Documentation

PofBufferWriter ( WriteBuffer::BufferOutput::Handle  hOut,
    PofContext::View  vCtx  
  )     [protected]

Construct a new PofBufferWriter that will write a POF stream to the passed BufferOutput object.

Parameters:
  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.

Parameters:
  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

Member Function Documentation

virtual void writeUserType ( int32_t  iProp,
    Object::View  v  
  )     [protected, virtual]

Write a property of user defined type to the POF stream.

Parameters:
  iProp  the property index
  v  the user type property value to write
Since:
Coherence 3.7.1

virtual PofBufferWriter::Handle getParentWriter (    )  [protected, virtual]

If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.

Returns:
the containing writer

Reimplemented in UserTypeWriter.

virtual PofBufferWriter::View getParentWriter (    )  const [protected, virtual]

If this writer is contextually within a user type, obtain the writer which created this writer in order to write the user type.

Returns:
the containing writer

Reimplemented in UserTypeWriter.

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.

Parameters:
  iProp  the index of the property being written
Exceptions:
  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.

Parameters:
  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.

Parameters:
  vClass  the expected class; must not be NULL
  vClassTest  the class to test for equality; must not be NULL
Exceptions:
  IllegalStateException  if the second class is not equal to the first

virtual bool isReferenceEnabled (    )  [virtual]

Determine if reference support is enabled.

Returns:
true iff reference support is enabled
Since:
Coherence 3.7.1

virtual WriteBuffer::BufferOutput::Handle getBufferOutput (    )  [protected, virtual]

Return the BufferOutput that this PofBufferWriter writes to.

Returns:
the BufferOutput

virtual WriteBuffer::BufferOutput::View getBufferOutput (    )  const [protected, virtual]

Return the BufferOutput that this PofBufferWriter writes to.

Returns:
the BufferOutput

virtual WritingPofHandler::Handle getPofHandler (    )  [protected, virtual]

Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.

Returns:
the PofHandler

virtual WritingPofHandler::View getPofHandler (    )  const [protected, virtual]

Return the WritingPofHandler used internally by this PofBufferWriter to write the POF stream.

Returns:
the PofHandler

virtual bool isEvolvable (    )  [protected, virtual]

Determine if the object to be written is either Evolvable or part of an Evolvable object.

Returns:
true iff the object to be written is Evolvable
Since:
Coherence 3.7.1

Reimplemented in UserTypeWriter.

virtual void setEvolvable ( bool  fEvolvable  )  [protected, virtual]

Set the Evolvable flag to indicate if the object to be written is Evolvable or part of an Evolvable object.

Parameters:
  fEvolvable  true iff the object to be written is Evolvable
Since:
Coherence 3.7.1

The documentation for this class was generated from the following file:

Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.