|
activemq-cpp-3.9.5
|
#include <src/main/decaf/internal/nio/ShortArrayBuffer.h>

Public Member Functions | |||||||||
| ShortArrayBuffer (int size, bool readOnly=false) | |||||||||
| Creates a ShortArrayBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted. | |||||||||
| ShortArrayBuffer (short *array, int size, int offset, int length, bool readOnly=false) | |||||||||
| Creates a ShortArrayBuffer object that wraps the given array. | |||||||||
| ShortArrayBuffer (const decaf::lang::Pointer< ByteArrayAdapter > &array, int offset, int length, bool readOnly=false) | |||||||||
| Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset. | |||||||||
| ShortArrayBuffer (const ShortArrayBuffer &other) | |||||||||
| Create a ShortArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArrayAdapter and when changes are made to that data it is reflected in both. | |||||||||
| virtual | ~ShortArrayBuffer () | ||||||||
| virtual short * | array () | ||||||||
Returns the short array that backs this buffer (optional operation).Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| |||||||||
| virtual int | arrayOffset () | ||||||||
Returns the offset within this buffer's backing array of the first element of the buffer (optional operation).Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| |||||||||
| virtual ShortBuffer * | asReadOnlyBuffer () const | ||||||||
Creates a new, read-only short buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffers' position, limit, and mark values will be independent.If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.
| |||||||||
| virtual ShortBuffer & | compact () | ||||||||
Compacts this buffer.The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded.The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.
| |||||||||
| virtual ShortBuffer * | duplicate () | ||||||||
Creates a new short buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||
| virtual short | get () | ||||||||
Relative get method.Reads the value at this buffer's current position, and then increments the position.
| |||||||||
| virtual short | get (int index) const | ||||||||
Absolute get method.Reads the value at the given index.
| |||||||||
| virtual bool | hasArray () const | ||||||||
Tells whether or not this buffer is backed by an accessible short array.If this method returns true then the array and arrayOffset methods may safely be invoked. Subclasses should override this method if they do not have a backing array as this class always returns true.
| |||||||||
| virtual bool | isReadOnly () const | ||||||||
Tells whether or not this buffer is read-only.
| |||||||||
| virtual ShortBuffer & | put (short value) | ||||||||
Writes the given shorts into this buffer at the current position, and then increments the position.
| |||||||||
| virtual ShortBuffer & | put (int index, short value) | ||||||||
Writes the given shorts into this buffer at the given index.
| |||||||||
| virtual ShortBuffer * | slice () const | ||||||||
Creates a new ShortBuffer whose content is a shared subsequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
| |||||||||
| Public Member Functions inherited from decaf::nio::ShortBuffer | |||||||||
| virtual | ~ShortBuffer () | ||||||||
| virtual std::string | toString () const | ||||||||
| ShortBuffer & | get (std::vector< short > buffer) | ||||||||
| Relative bulk get method. | |||||||||
| ShortBuffer & | get (short *buffer, int size, int offset, int length) | ||||||||
| Relative bulk get method. | |||||||||
| ShortBuffer & | put (ShortBuffer &src) | ||||||||
| This method transfers the shorts remaining in the given source buffer into this buffer. | |||||||||
| ShortBuffer & | put (const short *buffer, int size, int offset, int length) | ||||||||
| This method transfers shorts into this buffer from the given source array. | |||||||||
| ShortBuffer & | put (std::vector< short > &buffer) | ||||||||
| This method transfers the entire content of the given source shorts array into this buffer. | |||||||||
| virtual int | compareTo (const ShortBuffer &value) const | ||||||||
| virtual bool | equals (const ShortBuffer &value) const | ||||||||
| virtual bool | operator== (const ShortBuffer &value) const | ||||||||
| virtual bool | operator< (const ShortBuffer &value) const | ||||||||
| Public Member Functions inherited from decaf::nio::Buffer | |||||||||
| Buffer (int capactiy) | |||||||||
| Buffer (const Buffer &other) | |||||||||
| virtual | ~Buffer () | ||||||||
| virtual int | capacity () const | ||||||||
| virtual int | position () const | ||||||||
| virtual Buffer & | position (int newPosition) | ||||||||
| Sets this buffer's position. | |||||||||
| virtual int | limit () const | ||||||||
| virtual Buffer & | limit (int newLimit) | ||||||||
| Sets this buffer's limit. | |||||||||
| virtual Buffer & | mark () | ||||||||
| Sets this buffer's mark at its position. | |||||||||
| virtual Buffer & | reset () | ||||||||
| Resets this buffer's position to the previously-marked position. | |||||||||
| virtual Buffer & | clear () | ||||||||
| Clears this buffer. | |||||||||
| virtual Buffer & | flip () | ||||||||
| Flips this buffer. | |||||||||
| virtual Buffer & | rewind () | ||||||||
| Rewinds this buffer. | |||||||||
| virtual int | remaining () const | ||||||||
| Returns the number of elements between the current position and the limit. | |||||||||
| virtual bool | hasRemaining () const | ||||||||
| Tells whether there are any elements between the current position and the limit. | |||||||||
| Public Member Functions inherited from decaf::lang::Comparable< ShortBuffer > | |||||||||
| virtual | ~Comparable () | ||||||||
| virtual int | compareTo (const ShortBuffer &value) const=0 | ||||||||
| Compares this object with the specified object for order. | |||||||||
| virtual bool | equals (const ShortBuffer &value) const=0 | ||||||||
| virtual bool | operator== (const ShortBuffer &value) const=0 | ||||||||
| Compares equality between this object and the one passed. | |||||||||
| virtual bool | operator< (const ShortBuffer &value) const=0 | ||||||||
| Compares this object to another and returns true if this object is considered to be less than the one passed. | |||||||||
Protected Member Functions | |
| virtual void | setReadOnly (bool value) |
| Sets this ShortArrayBuffer as Read-Only. | |
| Protected Member Functions inherited from decaf::nio::ShortBuffer | |
| ShortBuffer (int capacity) | |
| Creates a ShortBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from decaf::nio::ShortBuffer | |
| static ShortBuffer * | allocate (int capacity) |
| Allocates a new Double buffer. | |
| static ShortBuffer * | wrap (short *array, int size, int offset, int length) |
| Wraps the passed buffer with a new ShortBuffer. | |
| static ShortBuffer * | wrap (std::vector< short > &buffer) |
| Wraps the passed STL short Vector in a ShortBuffer. | |
| Protected Attributes inherited from decaf::nio::Buffer | |
| int | _position |
| int | _capacity |
| int | _limit |
| int | _mark |
| bool | _markSet |
| decaf::internal::nio::ShortArrayBuffer::ShortArrayBuffer | ( | int | size, |
| bool | readOnly = false ) |
Creates a ShortArrayBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted.
The array is initially created with all elements initialized to zero.
| size | The size of the array, this is the limit we read and write to. |
| readOnly | Boolean indicating if this buffer should be read-only, default as false. |
| IllegalArguementException | if the capacity value is negative. |
Referenced by ShortArrayBuffer().
| decaf::internal::nio::ShortArrayBuffer::ShortArrayBuffer | ( | short * | array, |
| int | size, | ||
| int | offset, | ||
| int | length, | ||
| bool | readOnly = false ) |
Creates a ShortArrayBuffer object that wraps the given array.
If the own flag is set then it will delete this array when this object is deleted.
| array | The actual array to wrap. |
| size | The size of the given array. |
| offset | The position that is this buffers start position. |
| length | The limit of how many bytes into the array this Buffer can write. |
| readOnly | Boolean indicating if this buffer should be read-only, default as false. |
| NullPointerException | if buffer is NULL |
| IndexOutOfBoundsException | if offset is greater than array capacity. |
References array().
| decaf::internal::nio::ShortArrayBuffer::ShortArrayBuffer | ( | const decaf::lang::Pointer< ByteArrayAdapter > & | array, |
| int | offset, | ||
| int | length, | ||
| bool | readOnly = false ) |
Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset.
The capacity and limit of the new ShortArrayBuffer will be that of the remaining capacity of the passed buffer.
| array | The ByteArrayAdapter to wrap. |
| offset | The position that is this buffers start position. |
| length | The limit of how many bytes into the array this Buffer can write. |
| readOnly | Boolean indicating if this buffer should be read-only, default as false. |
| NullPointerException | if array is NULL |
| IndexOutOfBoundsException | if offset + length is greater than array size. |
References array().
| decaf::internal::nio::ShortArrayBuffer::ShortArrayBuffer | ( | const ShortArrayBuffer & | other | ) |
Create a ShortArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArrayAdapter and when changes are made to that data it is reflected in both.
| other | The ShortArrayBuffer this one is to mirror. |
References ShortArrayBuffer().
|
virtual |
|
virtual |
Returns the short array that backs this buffer (optional operation).Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| ReadOnlyBufferException | if this Buffer is read only. |
| UnsupportedOperationException | if the underlying store has no array. |
Implements decaf::nio::ShortBuffer.
Referenced by ShortArrayBuffer(), and ShortArrayBuffer().
|
virtual |
Returns the offset within this buffer's backing array of the first element of the buffer (optional operation).Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.
| ReadOnlyBufferException | if this Buffer is read only. |
| UnsupportedOperationException | if the underlying store has no array. |
Implements decaf::nio::ShortBuffer.
|
virtual |
Creates a new, read-only short buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffers' position, limit, and mark values will be independent.If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().
|
virtual |
Compacts this buffer.The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded.The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().
|
virtual |
Creates a new short buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().
|
virtual |
Relative get method.Reads the value at this buffer's current position, and then increments the position.
| BufferUnderflowException | if there no more data to return. |
Implements decaf::nio::ShortBuffer.
|
virtual |
Absolute get method.Reads the value at the given index.
| index | The index in the Buffer where the short is to be read. |
| IndexOutOfBoundsException | if index is not smaller than the buffer's limit, or the index is negative. |
Implements decaf::nio::ShortBuffer.
|
inlinevirtual |
Tells whether or not this buffer is backed by an accessible short array.If this method returns true then the array and arrayOffset methods may safely be invoked. Subclasses should override this method if they do not have a backing array as this class always returns true.
Implements decaf::nio::ShortBuffer.
|
inlinevirtual |
Tells whether or not this buffer is read-only.
Implements decaf::nio::Buffer.
|
virtual |
Writes the given shorts into this buffer at the given index.
| index | The position in the Buffer to write the data. |
| value | The shorts to write. |
| IndexOutOfBoundsException | if index greater than the buffer's limit minus the size of the type being written. |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().
|
virtual |
Writes the given shorts into this buffer at the current position, and then increments the position.
| value | The shorts value to be written. |
| BufferOverflowException | if this buffer's current position is not smaller than its limit. |
| ReadOnlyBufferException | if this buffer is read-only. |
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().
|
inlineprotectedvirtual |
Sets this ShortArrayBuffer as Read-Only.
| value | Boolean value, true if this buffer is to be read-only, false otherwise. |
|
virtual |
Creates a new ShortBuffer whose content is a shared subsequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.
Implements decaf::nio::ShortBuffer.
References decaf::nio::ShortBuffer::ShortBuffer().