activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r599863 - in /activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio: CharBuffer.cpp CharBuffer.h
Date Fri, 30 Nov 2007 16:31:01 GMT
Author: tabish
Date: Fri Nov 30 08:30:58 2007
New Revision: 599863

URL: http://svn.apache.org/viewvc?rev=599863&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Starting the NIO implementation; CharBuffer

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.cpp
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.h

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.cpp?rev=599863&r1=599862&r2=599863&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.cpp Fri Nov 30 08:30:58
2007
@@ -27,10 +27,9 @@
 using namespace decaf::nio;
 using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
-using namespace decaf::internal::nio;
 
 ////////////////////////////////////////////////////////////////////////////////
-CharBuffer::CharBuffer( std::size_t capacity, bool readOnly )
- :  ByteBuffer( capacity, readOnly ) {
+CharBuffer::CharBuffer( std::size_t capacity )
+ :  Buffer( capacity ) {
 
-}
\ No newline at end of file
+}

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.h?rev=599863&r1=599862&r2=599863&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/CharBuffer.h Fri Nov 30 08:30:58
2007
@@ -25,6 +25,9 @@
 #include <decaf/nio/BufferUnderflowException.h>
 #include <decaf/nio/BufferOverflowException.h>
 #include <decaf/nio/ReadOnlyBufferException.h>
+#include <decaf/io/IOException.h>
+#include <decaf/lang/CharSequence.h>
+#include <decaf/lang/Appendable.h>
 
 namespace decaf{
 namespace nio{
@@ -60,17 +63,21 @@
      *
      *     cb.put("text/").put(subtype).put("; charset=").put(enc);
      */
-    class CharBuffer : public Buffer {
-    public:
+    class CharBuffer : public Buffer,
+                       public lang::CharSequence,
+                       public lang::Appendable,
+                       public lang::Comparable<CharBuffer> {
+    protected:
 
         /**
          * Creates a CharBuffer 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.
          * @param capacity - size of the array, this is the limit we read and write to.
-         * @param readOnly - should this buffer be read-only, default as false
          */
-        CharBuffer( std::size_t capacity, bool readOnly );
+        CharBuffer( std::size_t capacity );
+
+    public:
 
         virtual ~CharBuffer() {}
 
@@ -79,8 +86,6 @@
          */
         virtual std::string toString() const;
 
-    public:
-
         /**
          * Appends the specified character to this buffer
          * @param value - the char to append.
@@ -99,7 +104,7 @@
          * @throws BufferOverflowException if there is no more space
          * @throws ReadOnlyBufferException if this Buffer is read only.
          */
-        CharBuffer& append( const CharSequence* value )
+        CharBuffer& append( const lang::CharSequence* value )
             throw ( BufferOverflowException, ReadOnlyBufferException );
 
         /**
@@ -113,7 +118,7 @@
          * @throws ReadOnlyBufferException if this Buffer is read only.
          * @throws IndexOutOfBoundsException if start > end, or > length of sequence.
          */
-        CharBuffer& append( const CharSequence* value, std::size_t start, std::size_t
end )
+        CharBuffer& append( const lang::CharSequence* value, std::size_t start, std::size_t
end )
             throw ( decaf::lang::exceptions::IndexOutOfBoundsException,
                     BufferOverflowException, ReadOnlyBufferException );
 
@@ -163,7 +168,7 @@
          * identical to those of this buffer.
          * @return The new, read-only char buffer which the caller then owns.
          */
-        virtual CharBuffer* asReadOnlyBuffer() const = 0
+        virtual CharBuffer* asReadOnlyBuffer() const = 0;
 
         /**
          * Reads the character at the given index relative to the current position.
@@ -405,7 +410,6 @@
          * @param target - the buffer to read characters into
          * @returns The number of characters added to the buffer, or string::npos if this
          * source of characters is at its end
-         * @throws IOException - IF an IO error occurs
          * @throws NullPointerException - If target is Null
          * @throws ReadOnlyBufferException - If this buffer is read-only
          */
@@ -431,7 +435,7 @@
          * @return The new character buffer, caller owns
          * @throws IndexOutOfBoundsException - If the preconditions on start and end fail
          */
-        virtual CharSequence* subSequence( std::size_t start, std::size_t end )
+        virtual lang::CharSequence* subSequence( std::size_t start, std::size_t end )
             throw ( decaf::lang::exceptions::IndexOutOfBoundsException ) = 0;
 
         /**
@@ -539,7 +543,7 @@
          * @throws NullPointerException if csq is null.
          * @throws IndexOutOfBoundsException if the preconditions on start and end fail
          */
-        static CharBuffer* wrap( CharSequence* csq, std::size_t start, std::size_t end )
+        static CharBuffer* wrap( lang::CharSequence* csq, std::size_t start, std::size_t
end )
             throw( lang::exceptions::NullPointerException );
 
         /**
@@ -554,7 +558,7 @@
          * @returns the newly created CharBuffer, caller owns.
          * @throws NullPointerException if csq is null.
          */
-        static CharBuffer* wrap( CharSequence* csq )
+        static CharBuffer* wrap( lang::CharSequence* csq )
             throw ( decaf::lang::exceptions::NullPointerException );
 
     };



Mime
View raw message