activemq-cpp-3.6.0
decaf::internal::nio::BufferFactory Class Reference

Factory class used by static methods in the decaf::nio package to create the various default version of the NIO interfaces. More...

#include <src/main/decaf/internal/nio/BufferFactory.h>

Public Member Functions

virtual ~BufferFactory ()

Static Public Member Functions

static decaf::nio::ByteBuffercreateByteBuffer (int capacity)
 Allocates a new byte buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::ByteBuffercreateByteBuffer (unsigned char *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new ByteBuffer.
static decaf::nio::ByteBuffercreateByteBuffer (std::vector< unsigned char > &buffer)
 Wraps the passed STL Byte Vector in a ByteBuffer.
static decaf::nio::CharBuffercreateCharBuffer (int capacity)
 Allocates a new char buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::CharBuffercreateCharBuffer (char *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new CharBuffer.
static decaf::nio::CharBuffercreateCharBuffer (std::vector< char > &buffer)
 Wraps the passed STL Byte Vector in a CharBuffer.
static decaf::nio::DoubleBuffercreateDoubleBuffer (int capacity)
 Allocates a new double buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::DoubleBuffercreateDoubleBuffer (double *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new DoubleBuffer.
static decaf::nio::DoubleBuffercreateDoubleBuffer (std::vector< double > &buffer)
 Wraps the passed STL Double Vector in a DoubleBuffer.
static decaf::nio::FloatBuffercreateFloatBuffer (int capacity)
 Allocates a new float buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::FloatBuffercreateFloatBuffer (float *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new FloatBuffer.
static decaf::nio::FloatBuffercreateFloatBuffer (std::vector< float > &buffer)
 Wraps the passed STL Float Vector in a FloatBuffer.
static decaf::nio::LongBuffercreateLongBuffer (int capacity)
 Allocates a new long long buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::LongBuffercreateLongBuffer (long long *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new LongBuffer.
static decaf::nio::LongBuffercreateLongBuffer (std::vector< long long > &buffer)
 Wraps the passed STL Long Vector in a LongBuffer.
static decaf::nio::IntBuffercreateIntBuffer (int capacity)
 Allocates a new int buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::IntBuffercreateIntBuffer (int *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new IntBuffer.
static decaf::nio::IntBuffercreateIntBuffer (std::vector< int > &buffer)
 Wraps the passed STL int Vector in a IntBuffer.
static decaf::nio::ShortBuffercreateShortBuffer (int capacity)
 Allocates a new short buffer whose position will be zero its limit will be its capacity and its mark is not set.
static decaf::nio::ShortBuffercreateShortBuffer (short *buffer, int size, int offset, int length)
 Wraps the passed buffer with a new ShortBuffer.
static decaf::nio::ShortBuffercreateShortBuffer (std::vector< short > &buffer)
 Wraps the passed STL Short Vector in a ShortBuffer.

Detailed Description

Factory class used by static methods in the decaf::nio package to create the various default version of the NIO interfaces.

Since
1.0

Constructor & Destructor Documentation

virtual decaf::internal::nio::BufferFactory::~BufferFactory ( )
inlinevirtual

Member Function Documentation

static decaf::nio::ByteBuffer* decaf::internal::nio::BufferFactory::createByteBuffer ( int  capacity)
static

Allocates a new byte buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated ByteBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::ByteBuffer* decaf::internal::nio::BufferFactory::createByteBuffer ( unsigned char *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new ByteBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new ByteBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::ByteBuffer* decaf::internal::nio::BufferFactory::createByteBuffer ( std::vector< unsigned char > &  buffer)
static

Wraps the passed STL Byte Vector in a ByteBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new ByteBuffer that is backed by buffer, caller owns.
static decaf::nio::CharBuffer* decaf::internal::nio::BufferFactory::createCharBuffer ( int  capacity)
static

Allocates a new char buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated CharBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::CharBuffer* decaf::internal::nio::BufferFactory::createCharBuffer ( char *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new CharBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new CharBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::CharBuffer* decaf::internal::nio::BufferFactory::createCharBuffer ( std::vector< char > &  buffer)
static

Wraps the passed STL Byte Vector in a CharBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new CharBuffer that is backed by buffer, caller owns.
static decaf::nio::DoubleBuffer* decaf::internal::nio::BufferFactory::createDoubleBuffer ( int  capacity)
static

Allocates a new double buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated DoubleBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::DoubleBuffer* decaf::internal::nio::BufferFactory::createDoubleBuffer ( double *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new DoubleBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new DoubleBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::DoubleBuffer* decaf::internal::nio::BufferFactory::createDoubleBuffer ( std::vector< double > &  buffer)
static

Wraps the passed STL Double Vector in a DoubleBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new DoubleBuffer that is backed by buffer, caller owns.
static decaf::nio::FloatBuffer* decaf::internal::nio::BufferFactory::createFloatBuffer ( int  capacity)
static

Allocates a new float buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated FloatBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::FloatBuffer* decaf::internal::nio::BufferFactory::createFloatBuffer ( float *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new FloatBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new FloatBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::FloatBuffer* decaf::internal::nio::BufferFactory::createFloatBuffer ( std::vector< float > &  buffer)
static

Wraps the passed STL Float Vector in a FloatBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new FloatBuffer that is backed by buffer, caller owns.
static decaf::nio::IntBuffer* decaf::internal::nio::BufferFactory::createIntBuffer ( int  capacity)
static

Allocates a new int buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated IntBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::IntBuffer* decaf::internal::nio::BufferFactory::createIntBuffer ( int *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new IntBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new IntBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::IntBuffer* decaf::internal::nio::BufferFactory::createIntBuffer ( std::vector< int > &  buffer)
static

Wraps the passed STL int Vector in a IntBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new IntBuffer that is backed by buffer, caller owns.
static decaf::nio::LongBuffer* decaf::internal::nio::BufferFactory::createLongBuffer ( int  capacity)
static

Allocates a new long long buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacity- the internal buffer's capacity.
Returns
a newly allocated DoubleBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::LongBuffer* decaf::internal::nio::BufferFactory::createLongBuffer ( long long *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new LongBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new LongBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::LongBuffer* decaf::internal::nio::BufferFactory::createLongBuffer ( std::vector< long long > &  buffer)
static

Wraps the passed STL Long Vector in a LongBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new LongBuffer that is backed by buffer, caller owns.
static decaf::nio::ShortBuffer* decaf::internal::nio::BufferFactory::createShortBuffer ( int  capacity)
static

Allocates a new short buffer whose position will be zero its limit will be its capacity and its mark is not set.

Parameters
capacityThe internal buffer's capacity.
Returns
a newly allocated ShortBuffer which the caller owns.
Exceptions
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::ShortBuffer* decaf::internal::nio::BufferFactory::createShortBuffer ( short *  buffer,
int  size,
int  offset,
int  length 
)
static

Wraps the passed buffer with a new ShortBuffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe array that will back the new buffer.
sizeThe size of the specified buffer.
offsetThe offset of the subarray to be used.
lengthThe length of the subarray to be used.
Returns
a new ShortBuffer that is backed by buffer, caller owns the returned pointer.
Exceptions
NullPointerExceptionif the buffer given in Null.
IndexOutOfBoundsExceptionif the capacity specified is negative.
static decaf::nio::ShortBuffer* decaf::internal::nio::BufferFactory::createShortBuffer ( std::vector< short > &  buffer)
static

Wraps the passed STL Short Vector in a ShortBuffer.

The new buffer will be backed by the given byte array; modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be buffer.size(), its position will be zero, and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero.

Parameters
bufferThe vector that will back the new buffer, the vector must have been sized to the desired size already by calling vector.resize( N ).
Returns
a new DoubleBuffer that is backed by buffer, caller owns.

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