You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/12/02 18:28:52 UTC
svn commit: r600345 - in /activemq/activemq-cpp/decaf/trunk/src/main:
Makefile.am decaf/internal/nio/ByteBuffer.cpp
decaf/internal/nio/ByteBuffer.h decaf/nio/ByteBuffer.cpp
Author: tabish
Date: Sun Dec 2 09:28:51 2007
New Revision: 600345
URL: http://svn.apache.org/viewvc?rev=600345&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
Working on the NIO package
Modified:
activemq/activemq-cpp/decaf/trunk/src/main/Makefile.am
activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.cpp
activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.h
activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
Modified: activemq/activemq-cpp/decaf/trunk/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/Makefile.am?rev=600345&r1=600344&r2=600345&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/Makefile.am Sun Dec 2 09:28:51 2007
@@ -25,7 +25,7 @@
decaf/internal/util/HexStringParser.cpp \
decaf/internal/util/ByteArray.cpp \
decaf/internal/nio/ByteArrayPerspective.cpp \
-// decaf/internal/nio/ByteBuffer.cpp \
+ decaf/internal/nio/ByteBuffer.cpp \
decaf/net/ServerSocket.cpp \
decaf/net/SocketOutputStream.cpp \
decaf/net/BufferedSocket.cpp \
@@ -196,7 +196,7 @@
decaf/internal/util/BigInt.h \
decaf/internal/util/ByteArray.h \
decaf/internal/nio/ByteArrayPerspective.h \
-// decaf/internal/nio/ByteBuffer.h \
+ decaf/internal/nio/ByteBuffer.h \
decaf/nio/Buffer.h \
decaf/nio/ByteBuffer.h \
decaf/nio/CharBuffer.h \
Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.cpp?rev=600345&r1=600344&r2=600345&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.cpp Sun Dec 2 09:28:51 2007
@@ -41,7 +41,8 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer::ByteArrayBuffer( unsigned char* array, std::size_t offset,
std::size_t capacity, bool own, bool readOnly )
- throw( decaf::lang::exceptions::NullPointerException ) : decaf::nio::ByteBuffer( capacity ) {
+ throw( decaf::lang::exceptions::NullPointerException )
+ : decaf::nio::ByteBuffer( capacity ) {
try{
@@ -59,7 +60,7 @@
ByteArrayBuffer::ByteArrayBuffer( ByteArrayPerspective& array, std::size_t offset,
std::size_t length, bool readOnly )
throw( decaf::lang::exceptions::IndexOutOfBoundsException )
- : decaf::nio::ByteBuffer( length ) {
+ : decaf::nio::ByteBuffer( length ) {
try{
if( offset > array.getCapacity() ) {
@@ -81,7 +82,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer::ByteArrayBuffer( const ByteArrayBuffer& other )
- : decaf::nio::ByteBuffer( other ) {
+ : decaf::nio::ByteBuffer( other ) {
// get the byte buffer of the caller and take a reference
this->_array = other._array->takeRef();
@@ -110,7 +111,7 @@
////////////////////////////////////////////////////////////////////////////////
unsigned char* ByteArrayBuffer::array()
- throw( ReadOnlyBufferException, UnsupportedOperationException ) {
+ throw( decaf::nio::ReadOnlyBufferException, UnsupportedOperationException ) {
try{
@@ -121,22 +122,22 @@
}
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::array() - Buffer is Read Only." );
}
return this->_array->getByteArray();
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( UnsupportedOperationException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, ReadOnlyBufferException )
- DECAF_CATCHALL_THROW( ReadOnlyBufferException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCHALL_THROW( decaf::nio::ReadOnlyBufferException )
}
////////////////////////////////////////////////////////////////////////////////
std::size_t ByteArrayBuffer::arrayOffset() const
- throw( ReadOnlyBufferException,
+ throw( decaf::nio::ReadOnlyBufferException,
lang::exceptions::UnsupportedOperationException ) {
try{
@@ -148,17 +149,17 @@
}
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::arrayOffset() - Buffer is Read Only." );
}
return this->offset;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( UnsupportedOperationException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, ReadOnlyBufferException )
- DECAF_CATCHALL_THROW( ReadOnlyBufferException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCHALL_THROW( decaf::nio::ReadOnlyBufferException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -176,12 +177,12 @@
}
////////////////////////////////////////////////////////////////////////////////
-ByteArrayBuffer& ByteArrayBuffer::compact() throw( ReadOnlyBufferException ) {
+ByteArrayBuffer& ByteArrayBuffer::compact() throw( decaf::nio::ReadOnlyBufferException ) {
try{
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::compact() - Buffer is Read Only." );
}
@@ -198,21 +199,28 @@
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, ReadOnlyBufferException )
- DECAF_CATCHALL_THROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCHALL_THROW( decaf::nio::ReadOnlyBufferException )
}
////////////////////////////////////////////////////////////////////////////////
-unsigned char ByteArrayBuffer::get() const throw( BufferUnderflowException ) {
+ByteArrayBuffer* ByteArrayBuffer::duplicate() {
+
+ // TODO
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char ByteArrayBuffer::get() const throw( decaf::nio::BufferUnderflowException ) {
try{
return this->get( this->_position++ );
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -235,16 +243,16 @@
}
////////////////////////////////////////////////////////////////////////////////
-double ByteArrayBuffer::getDouble() throw( BufferUnderflowException ) {
+double ByteArrayBuffer::getDouble() throw( decaf::nio::BufferUnderflowException ) {
try{
unsigned long long lvalue = this->getLong();
return Double::longBitsToDouble( lvalue );
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -262,16 +270,16 @@
}
////////////////////////////////////////////////////////////////////////////////
-float ByteArrayBuffer::getFloat() throw( BufferUnderflowException ) {
+float ByteArrayBuffer::getFloat() throw( decaf::nio::BufferUnderflowException ) {
try{
unsigned int ivalue = this->getInt();
return Float::intBitsToFloat( ivalue );
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -289,7 +297,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-long long ByteArrayBuffer::getLong() throw( BufferUnderflowException ) {
+long long ByteArrayBuffer::getLong() throw( decaf::nio::BufferUnderflowException ) {
try{
@@ -297,9 +305,9 @@
this->_position += sizeof(value);
return value;
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException )
}
////////////////////////////////////////////////////////////////////////////////
@@ -340,7 +348,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-int ByteArrayBuffer::getInt() throw( BufferUnderflowException ) {
+int ByteArrayBuffer::getInt() throw( decaf::nio::BufferUnderflowException ) {
try{
@@ -348,9 +356,9 @@
this->_position += sizeof(value);
return value;
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException );
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException );
}
////////////////////////////////////////////////////////////////////////////////
@@ -379,7 +387,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-short ByteArrayBuffer::getShort() throw( BufferUnderflowException ) {
+short ByteArrayBuffer::getShort() throw( decaf::nio::BufferUnderflowException ) {
try{
@@ -387,9 +395,9 @@
this->_position += sizeof(value);
return value;
}
- DECAF_CATCH_RETHROW( BufferUnderflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferUnderflowException )
- DECAF_CATCHALL_THROW( BufferUnderflowException );
+ DECAF_CATCH_RETHROW( decaf::nio::BufferUnderflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferUnderflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferUnderflowException );
}
////////////////////////////////////////////////////////////////////////////////
@@ -418,28 +426,28 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::put( unsigned char value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
this->put( this->_position++, value );
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::put( std::size_t index, unsigned char value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::put(i,i) - Buffer is Read Only." );
}
@@ -454,7 +462,7 @@
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -462,30 +470,30 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putChar( char value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
this->put( this->_position++, value );
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putChar( std::size_t index, char value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
this->put( index, value );
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -493,7 +501,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putDouble( double value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
@@ -501,23 +509,23 @@
this->_position += sizeof(value);
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putDouble( std::size_t index, double value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
this->putLong( index, Double::doubleToLongBits( value ) );
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -525,7 +533,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putFloat( float value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
@@ -533,23 +541,23 @@
this->_position += sizeof(value);
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putFloat( std::size_t index, float value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
this->putInt( index, Float::floatToIntBits( value ) );
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -557,7 +565,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putLong( long long value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
@@ -565,21 +573,21 @@
this->_position += sizeof(value);
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putLong( std::size_t index, long long value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::putLong() - Buffer is Read Only." );
}
@@ -599,7 +607,7 @@
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -607,7 +615,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putInt( int value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
@@ -615,21 +623,21 @@
this->_position += sizeof(value);
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putInt( std::size_t index, int value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::putInt() - Buffer is Read Only." );
}
@@ -645,7 +653,7 @@
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
@@ -653,7 +661,7 @@
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putShort( short value )
- throw( BufferOverflowException, ReadOnlyBufferException ) {
+ throw( decaf::nio::BufferOverflowException, decaf::nio::ReadOnlyBufferException ) {
try{
@@ -661,21 +669,21 @@
this->_position += sizeof(value);
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
- DECAF_CATCH_RETHROW( BufferOverflowException )
- DECAF_CATCH_EXCEPTION_CONVERT( Exception, BufferOverflowException )
- DECAF_CATCHALL_THROW( BufferOverflowException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::BufferOverflowException )
+ DECAF_CATCH_EXCEPTION_CONVERT( Exception, decaf::nio::BufferOverflowException )
+ DECAF_CATCHALL_THROW( decaf::nio::BufferOverflowException )
}
////////////////////////////////////////////////////////////////////////////////
ByteArrayBuffer& ByteArrayBuffer::putShort( std::size_t index, short value )
throw( lang::exceptions::IndexOutOfBoundsException,
- ReadOnlyBufferException ) {
+ decaf::nio::ReadOnlyBufferException ) {
try{
if( this->isReadOnly() ) {
- throw ReadOnlyBufferException(
+ throw decaf::nio::ReadOnlyBufferException(
__FILE__, __LINE__,
"ByteArrayBuffer::putShort() - Buffer is Read Only." );
}
@@ -689,7 +697,7 @@
return *this;
}
- DECAF_CATCH_RETHROW( ReadOnlyBufferException )
+ DECAF_CATCH_RETHROW( decaf::nio::ReadOnlyBufferException )
DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IndexOutOfBoundsException )
DECAF_CATCHALL_THROW( IndexOutOfBoundsException )
Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.h?rev=600345&r1=600344&r2=600345&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/ByteBuffer.h Sun Dec 2 09:28:51 2007
@@ -15,8 +15,8 @@
* limitations under the License.
*/
-#ifndef _DECAF_NIO_BYTEBUFFER_H_
-#define _DECAF_NIO_BYTEBUFFER_H_
+#ifndef _DECAF_INTERNAL_NIO_BYTEBUFFER_H_
+#define _DECAF_INTERNAL_NIO_BYTEBUFFER_H_
#include <decaf/nio/ByteBuffer.h>
#include <decaf/lang/exceptions/NullPointerException.h>
@@ -26,6 +26,13 @@
#include <decaf/nio/ReadOnlyBufferException.h>
#include <decaf/internal/nio/ByteArrayPerspective.h>
+#include <decaf/nio/CharBuffer.h>
+#include <decaf/nio/DoubleBuffer.h>
+#include <decaf/nio/FloatBuffer.h>
+#include <decaf/nio/ShortBuffer.h>
+#include <decaf/nio/IntBuffer.h>
+#include <decaf/nio/LongBuffer.h>
+
namespace decaf{
namespace internal{
namespace nio{
@@ -224,7 +231,7 @@
* The new buffer will be read-only if, and only if, this buffer is read-only.
* @returns the new Char Buffer, which the caller then owns.
*/
- //virtual CharBuffer* asCharBuffer() const = 0;
+ virtual decaf::nio::CharBuffer* asCharBuffer() const { return NULL; } //TODO
/**
* Creates a view of this byte buffer as a double buffer.
@@ -239,7 +246,7 @@
* buffer is read-only.
* @returns the new double Buffer, which the caller then owns.
*/
- //virtual DoubleBuffer* asDoubleBuffer() const = 0;
+ virtual decaf::nio::DoubleBuffer* asDoubleBuffer() const { return NULL; } //TODO
/**
* Creates a view of this byte buffer as a float buffer.
@@ -254,7 +261,7 @@
* buffer is read-only.
* @returns the new float Buffer, which the caller then owns.
*/
- //virtual FloatBuffer* asFloatBuffer() const = 0;
+ virtual decaf::nio::FloatBuffer* asFloatBuffer() const { return NULL; } //TODO
/**
* Creates a view of this byte buffer as a int buffer.
@@ -269,7 +276,7 @@
* buffer is read-only.
* @returns the new int Buffer, which the caller then owns.
*/
- //virtual IntBuffer* asIntBuffer() const = 0;
+ virtual decaf::nio::IntBuffer* asIntBuffer() const { return NULL; } //TODO
/**
* Creates a view of this byte buffer as a long buffer.
@@ -284,7 +291,7 @@
* buffer is read-only.
* @returns the new long Buffer, which the caller then owns.
*/
- //virtual LongBuffer* asLongBuffer() const = 0;
+ virtual decaf::nio::LongBuffer* asLongBuffer() const { return NULL; } //TODO
/**
* Creates a view of this byte buffer as a short buffer.
@@ -299,7 +306,7 @@
* buffer is read-only.
* @returns the new short Buffer, which the caller then owns.
*/
- //virtual ShortBuffer* asShortBuffer() const = 0;
+ virtual decaf::nio::ShortBuffer* asShortBuffer() const { return NULL; } //TODO
/**
* Creates a new, read-only byte buffer that shares this buffer's content.
@@ -349,9 +356,7 @@
* this buffer is read-only.
* @returns a new Byte Buffer which the caller owns.
*/
- virtual ByteArrayBuffer* duplicate() {
- return new ByteArrayBuffer( *this );
- }
+ virtual ByteArrayBuffer* duplicate();
/**
* Relative get method. Reads the byte at this buffer's current position, and
@@ -707,4 +712,4 @@
}}}
-#endif /*_DECAF_NIO_BYTEBUFFER_H_*/
+#endif /*_DECAF_INTERNAL_NIO_BYTEBUFFER_H_*/
Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp?rev=600345&r1=600344&r2=600345&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp Sun Dec 2 09:28:51 2007
@@ -16,7 +16,7 @@
*/
#include "ByteBuffer.h"
-//#include "decaf/internal/nio/ByteBuffer.h"
+#include "decaf/internal/nio/ByteBuffer.h"
#include "decaf/lang/Short.h"
#include "decaf/lang/Integer.h"
#include "decaf/lang/Long.h"
@@ -45,7 +45,7 @@
"ByteBuffer::allocate - Can't allocate zero sized ByteBuffer" );
}
- return new internal::nio::ByteBuffer( capacity );
+ return new internal::nio::ByteArrayBuffer( capacity );
}
DECAF_CATCH_RETHROW( IllegalArgumentException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
@@ -64,7 +64,7 @@
"ByteBuffer::wrap - Passed Buffer is Null.");
}
- return new internal::nio::ByteBuffer( buffer, offset, length, false );
+ return new internal::nio::ByteArrayBuffer( buffer, offset, length, false );
}
DECAF_CATCH_RETHROW( NullPointerException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
@@ -82,7 +82,7 @@
"ByteBuffer::wrap - Passed Buffer is Empty.");
}
- return internal::nio::ByteBuffer::wrap( &buffer[0], 0, buffer.size() );
+ return internal::nio::ByteArrayBuffer::wrap( &buffer[0], 0, buffer.size() );
}
DECAF_CATCH_RETHROW( NullPointerException )
DECAF_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )