Oracle Coherence for C++ API
Release 3.6.1.0

E18813-01

AbstractReadBuffer Class Reference

#include <coherence/io/AbstractReadBuffer.hpp>

Inherits Object, and ReadBuffer.

Inherited by OctetArrayReadBuffer.

List of all members.


Detailed Description

Abstract base implementation of the ReadBuffer interface.
Author:
jh 2007.12.31

Public Types

typedef spec::Handle  Handle
  AbstractReadBuffer Handle definition.
typedef spec::View  View
  AbstractReadBuffer View definition.
typedef spec::Holder  Holder
  AbstractReadBuffer Holder definition.
typedef this_spec::Handle  Handle
  ReadBuffer Handle definition.
typedef this_spec::View  View
  ReadBuffer View definition.
typedef this_spec::Holder  Holder
  ReadBuffer Holder definition.

Public Member Functions

virtual
BufferInput::Handle 
getBufferInput () const
  Get a BufferInput object to read data from this buffer.

Note that each call to this method will return a new BufferInput object, with the possible exception being that a zero-length ReadBuffer could always return the same instance (since there is nothing to read).

Returns:
a BufferInput that is reading from this buffer starting at offset zero

virtual ReadBuffer::View  getReadBuffer (size32_t of, size32_t cb) const
  Obtain a ReadBuffer for a portion of this ReadBuffer.
Parameters:
of  the beginning index, inclusive
cb  the number of octets to include in the resulting ReadBuffer
Returns:
a ReadBuffer that represents a portion of this ReadBuffer
Exceptions:
IndexOutOfBoundsException  if of + cb is larger than the length of this ReadBuffer

virtual Array
< octet_t >::View 
toOctetArray () const
  Get the contents of the ReadBuffer as an octet array.

This is the equivalent of toOctetArray(0, length()).

Returns:
an octet array with the contents of this ReadBuffer object

virtual Array
< octet_t >::View 
toOctetArray (size32_t of, size32_t cb) const
  Get a portion of the contents of the ReadBuffer as an octet array.
Parameters:
of  the beginning index, inclusive
cb  the number of octets to include in the resulting array
Returns:
an octet array containing the specified portion of this ReadBuffer
Exceptions:
IndexOutOfBoundsException  if of + cb is larger than the length of this ReadBuffer

virtual bool  equals (Object::View v) const
 

Static Public Member Functions

static Array
< octet_t >::Handle 
getEmptyOctetArray ()
  An empty octet array (by definition immutable).
static ReadBuffer::Handle  getEmptyReadBuffer ()
  A zero-length ReadBuffer (by definition immutable).

Protected Member Functions

virtual ReadBuffer::View  instantiateReadBuffer (size32_t of, size32_t cb) const =0
  Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer.
virtual
BufferInput::Handle 
instantiateBufferInput () const
  Factory method: Instantiate a BufferInput object to read data from the ReadBuffer.
virtual void  checkBounds (size32_t of, size32_t cb) const
  Check if the specified read is within bounds.

Classes

class   AbstractBufferInput
  This is an implementation of the BufferInput interface that delegates its work back to its ReadBuffer. More...

Member Function Documentation

virtual ReadBuffer::View instantiateReadBuffer ( size32_t  of,
size32_t  cb  
) const [protected, pure virtual]

Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer.

Parameters:
of  the beginning index, inclusive
cb  the number of bytes to include in the resulting ReadBuffer
Returns:
a ReadBuffer that represents a portion of this ReadBuffer

Implemented in OctetArrayReadBuffer, and Binary.

virtual BufferInput::Handle instantiateBufferInput (  )  const [protected, virtual]

Factory method: Instantiate a BufferInput object to read data from the ReadBuffer.

Returns:
a new BufferInput reading from this ReadBuffer

Reimplemented in OctetArrayReadBuffer.

virtual void checkBounds ( size32_t  of,
size32_t  cb  
) const [protected, virtual]

Check if the specified read is within bounds.

Parameters:
of  the absolute offset of the read operation
cb  the length in bytes of the read operation
Exceptions:
IndexOutOfBoundsException  if the specified read is not within bounds

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.