activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r594294 - in /activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio: ./ Buffer.cpp Buffer.h BufferOverlflowException.h BufferUnderflowException.h ByteBuffer.cpp ByteBuffer.h InvalidMarkException.h ReadOnlyBufferException.h
Date Mon, 12 Nov 2007 20:49:16 GMT
Author: tabish
Date: Mon Nov 12 12:49:15 2007
New Revision: 594294

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

Starting the NIO implementation

Added:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp   (with props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h   (with props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h   (with
props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h   (with
props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp   (with props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h   (with props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h   (with props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h   (with
props)

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp Mon Nov 12 12:49:15 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Buffer.h"
+
+using namespace decaf;
+using namespace decaf::nio;
+
+////////////////////////////////////////////////////////////////////////////////
+Buffer::Buffer() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Buffer::~Buffer() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Buffer& Buffer::position( int newPosition )
+    throw( lang::exceptions::IllegalArgumentException ) {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::limit( int newLimit ) throw( IllegalArgumentException ) {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::mark() {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::reset() throw ( InvalidMarkException ) {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::clear() {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::flip() {
+
+    return *this;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+virtual Buffer& Buffer::rewind() {
+
+    return *this;
+}

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h Mon Nov 12 12:49:15 2007
@@ -0,0 +1,272 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_BUFFER_H_
+#define _DECAF_NIO_BUFFER_H_
+
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+
+namespace decaf{
+namespace nio{
+
+    /**
+     * A container for data of a specific primitive type.
+     *
+     * A buffer is a linear, finite sequence of elements of a specific primitive
+     * type. Aside from its content, the essential properties of a buffer are
+     * its capacity, limit, and position:
+     *
+     * A buffer's capacity is the number of elements it contains. The capacity of a
+     * buffer is never negative and never changes.
+     *
+     * A buffer's limit is the index of the first element that should not be read
+     * or written. A buffer's limit is never negative and is never greater than its
+     * capacity.
+     *
+     * A buffer's position is the index of the next element to be read or written.
+     * A buffer's position is never negative and is never greater than its limit.
+     *
+     * There is one subclass of this class for each non-boolean primitive type.
+     *
+     * Transferring data:
+     *   Each subclass of this class defines two categories of get and put operations:
+     *   * Relative operations read or write one or more elements starting at the
+     *     current position and then increment the position by the number of
+     *     elements transferred. If the requested transfer exceeds the limit then a
+     *     relative get operation throws a BufferUnderflowException and a relative
+     *     put operation throws a BufferOverflowException; in either case, no data
+     *     is transferred.
+     *   * Absolute operations take an explicit element index and do not affect the
+     *     position. Absolute get and put operations throw an IndexOutOfBoundsException
+     *     if the index argument exceeds the limit.
+     *
+     *  Data may also, of course, be transferred in to or out of a buffer by the I/O
+     *  operations of an appropriate channel, which are always relative to the current
+     *  position.
+     *
+     * Marking and resetting:
+     *
+     *   A buffer's mark is the index to which its position will be reset when the
+     *   reset method is invoked. The mark is not always defined, but when it is
+     *   defined it is never negative and is never greater than the position. If the
+     *   mark is defined then it is discarded when the position or the limit is
+     *   adjusted to a value smaller than the mark. If the mark is not defined then
+     *   invoking the reset method causes an InvalidMarkException to be thrown.
+     *
+     * Invariants:
+     *
+     *   The following invariant holds for the mark, position, limit, and capacity values:
+     *     0 <= mark <= position <= limit <= capacity
+     *
+     *   A newly-created buffer always has a position of zero and a mark that is
+     *   undefined.  The initial limit may be zero, or it may be some other value that
+     *   depends upon the type of the buffer and the manner in which it is constructed.
+     *   The initial content of a buffer is, in general, undefined.
+     *
+     * Clearing, flipping, and rewinding:
+     *
+     *   In addition to methods for accessing the position, limit, and capacity values
+     *   and for marking and resetting, this class also defines the following operations
+     *   upon buffers:
+     *
+     *    clear() makes a buffer ready for a new sequence of channel-read or relative
+     *    put operations: It sets the limit to the capacity and the position to zero.
+     *
+     *    flip() makes a buffer ready for a new sequence of channel-write or relative
+     *    get operations: It sets the limit to the current position and then sets the
+     *    position to zero.
+     *
+     *    rewind() makes a buffer ready for re-reading the data that it already
+     *    contains: It leaves the limit unchanged and sets the position to zero.
+     *
+     * Read-only buffers:
+     *
+     *   Every buffer is readable, but not every buffer is writable. The mutation
+     *   methods of each buffer class are specified as optional operations that will
+     *   throw a ReadOnlyBufferException when invoked upon a read-only buffer. A
+     *   read-only buffer does not allow its content to be changed, but its mark,
+     *   position, and limit values are mutable. Whether or not a buffer is read-only
+     *   may be determined by invoking its isReadOnly method.
+     *
+     * Thread safety:
+     *
+     *   Buffers are not safe for use by multiple concurrent threads. If a buffer is to
+     *   be used by more than one thread then access to the buffer should be controlled
+     *   by appropriate synchronization.
+     *
+     * Invocation chaining:
+     *
+     *   Methods in this class that do not otherwise have a value to return are specified
+     *   to return the buffer upon which they are invoked. This allows method invocations
+     *   to be chained; for example, the sequence of statements
+     *
+     *     b.flip();
+     *     b.position(23);
+     *     b.limit(42);
+     *
+     *   can be replaced by the single, more compact statement
+     *     b.flip().position(23).limit(42);
+     */
+    class DECAF_API Buffer {
+    private:
+
+        int capacity;
+        int position;
+        int limit;
+        int mark;
+
+    public:
+
+        Buffer();
+        virtual ~Buffer();
+
+    public:
+
+        /**
+         * @returns this buffer's capacity.
+         */
+        virtual int capacity() const {
+            return this->capacity;
+        }
+
+        /**
+         * @returns the current position in the buffer
+         */
+        virtual int postion() const {
+            return this->position;
+        }
+
+        /**
+         * Sets this buffer's position. If the mark is defined and larger than the
+         * new position then it is discarded.
+         * @param newPosition - the new postion in the buffer to set.
+         * @returns A reference to This buffer
+         * @throws IllegalArgumentException if preconditions on the new pos don't hold.
+         */
+        virtual Buffer& position( int newPosition )
+            throw( lang::exceptions::IllegalArgumentException );
+
+        /**
+         * @returns this buffers Limit
+         */
+        virtual int limit() const {
+            return this->limit;
+        }
+
+        /**
+         * Sets this buffer's limit. If the position is larger than the new limit then
+         * it is set to the new limit. If the mark is defined and larger than the new
+         * limit then it is discarded.
+         * @param newLimit - The new limit value; must be non-negative and no larger
+         * than this buffer's capacity
+         * @returns A reference to This buffer
+         * @throws IllegalArgumentException if preconditions on the new pos don't hold.
+         */
+        virtual Buffer& limit( int newLimit )
+            throw( lang::exceptions::IllegalArgumentException );
+
+        /**
+         * Sets this buffer's mark at its position.
+         * @returns a reference to this buffer.
+         */
+        virtual Buffer& mark();
+
+        /**
+         * Resets this buffer's position to the previously-marked position.
+         * @returns a reference to this buffer.
+         * @throws InvalidMarkException - If the mark has not been set
+         */
+        virtual Buffer& reset() throw ( InvalidMarkException );
+
+        /**
+         * Clears this buffer. The position is set to zero, the limit is set to the
+         * capacity, and the mark is discarded.
+         * <p>
+         * Invoke this method before using a sequence of channel-read or put operations
+         * to fill this buffer. For example:
+         *
+         *    buf.clear();     // Prepare buffer for reading
+         *    in.read(buf);    // Read data
+         *
+         * This method does not actually erase the data in the buffer, but it is named
+         * as if it did because it will most often be used in situations in which that
+         * might as well be the case.
+         * @returns a reference to this buffer.
+         */
+        virtual Buffer& clear();
+
+        /**
+         * Flips this buffer. The limit is set to the current position and then the
+         * position is set to zero. If the mark is defined then it is discarded.
+         * <p>
+         * After a sequence of channel-read or put operations, invoke this method to
+         * prepare for a sequence of channel-write or relative get operations. For
+         * example:
+         *
+         *     buf.put(magic);    // Prepend header
+         *     in.read(buf);      // Read data into rest of buffer
+         *     buf.flip();        // Flip buffer
+         *     out.write(buf);    // Write header + data to channel
+         *
+         * This method is often used in conjunction with the compact method when
+         * transferring data from one place to another.
+         * @returns a reference to this buffer.
+         */
+        virtual Buffer& flip();
+
+        /**
+         * Rewinds this buffer. The position is set to zero and the mark is discarded.
+         * <p>
+         * Invoke this method before a sequence of channel-write or get operations,
+         * assuming that the limit has already been set appropriately. For example:
+         *
+         *    out.write(buf);    // Write remaining data
+         *    buf.rewind();      // Rewind buffer
+         *    buf.get(array);    // Copy data into array
+         *
+         * @returns a reference to this buffer.
+         */
+        virtual Buffer& rewind();
+
+        /**
+         * Returns the number of elements between the current position and the limit.
+         * @returns The number of elements remaining in this buffer
+         */
+        virtual int remaining() const {
+            return limit - position;
+        }
+
+        /**
+         * Tells whether there are any elements between the current position and the limit.
+         * @returns true if, and only if, there is at least one element remaining in
+         * this buffer
+         */
+        virtual bool hasRemaining() const {
+            return remaining() != 0;
+        }
+
+        /**
+         * Tells whether or not this buffer is read-only.
+         * @returns true if, and only if, this buffer is read-only
+         */
+        virtual bool isReadOnly() const = 0;
+
+    };
+
+}}
+
+#endif /*_DECAF_NIO_BUFFER_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/Buffer.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h Mon Nov
12 12:49:15 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_BUFFEROVERLFLOWEXCEPTION_H_
+#define _DECAF_NIO_BUFFEROVERLFLOWEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace nio{
+
+    class BufferOverlflowException {
+    public:
+        BufferOverlflowException() {}
+        virtual ~BufferOverlflowException() {}
+    };
+
+}}
+
+#endif /*_DECAF_NIO_BUFFEROVERLFLOWEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferOverlflowException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h Mon Nov
12 12:49:15 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_BUFFERUNDERFLOWEXCEPTION_H_
+#define _DECAF_NIO_BUFFERUNDERFLOWEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/Exception.h>
+
+namespace decaf{
+namespace nio{
+
+    class BufferUnderflowException {
+    public:
+
+        BufferUnderflowException() {}
+        virtual ~BufferUnderflowException() {}
+
+    };
+
+}}
+
+#endif /*_DECAF_NIO_BUFFERUNDERFLOWEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/BufferUnderflowException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp Mon Nov 12 12:49:15
2007
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ByteBuffer.h"
+
+using namespace decaf;
+using namespace decaf::nio;
+
+////////////////////////////////////////////////////////////////////////////////
+ByteBuffer::ByteBuffer() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ByteBuffer::~ByteBuffer() {
+}

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h Mon Nov 12 12:49:15
2007
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_BYTEBUFFER_H_
+#define _DECAF_NIO_BYTEBUFFER_H_
+
+#include <decaf/nio/Buffer.h>
+#include <decaf/lang/Comparable.h>
+
+namespace decaf{
+namespace nio{
+
+    /**
+     * This class defines six categories of operations upon byte buffers:
+     *
+     *  1. Absolute and relative get and put methods that read and write single bytes;
+     *  2. Relative bulk get methods that transfer contiguous sequences of bytes from
+     *     this buffer into an array;
+     *  3. Relative bulk put methods that transfer contiguous sequences of bytes from
+     *     a byte array or some other byte buffer into this buffer;
+     *  4. Absolute and relative get and put methods that read and write values of other
+     *     primitive types, translating them to and from sequences of bytes in a
+     *     particular byte order;
+     *  5. Methods for creating view buffers, which allow a byte buffer to be viewed as
+     *     a buffer containing values of some other primitive type; and
+     *  6. Methods for compacting, duplicating, and slicing a byte buffer.
+     *
+     * Byte buffers can be created either by allocation, which allocates space for the
+     * buffer's content, or by wrapping an existing byte array into a buffer.
+     *
+     * Access to binary data:
+     *
+     * This class defines methods for reading and writing values of all other primitive
+     * types, except boolean. Primitive values are translated to (or from) sequences of
+     * bytes according to the buffer's current byte order.
+     *
+     * For access to heterogeneous binary data, that is, sequences of values of
+     * different types, this class defines a family of absolute and relative get and
+     * put methods for each type. For 32-bit floating-point values, for example, this
+     * class defines:
+     *
+     *   float  getFloat()
+     *   float  getFloat(int index)
+     *   void  putFloat(float f)
+     *   void  putFloat(int index, float f)
+     *
+     * Corresponding methods are defined for the types char, short, int, long, and
+     * double. The index parameters of the absolute get and put methods are in terms
+     * of bytes rather than of the type being read or written.
+     *
+     * For access to homogeneous binary data, that is, sequences of values of the same
+     * type, this class defines methods that can create views of a given byte buffer.
+     * A view buffer is simply another buffer whose content is backed by the byte buffer.
+     * Changes to the byte buffer's content will be visible in the view buffer, and vice
+     * versa; the two buffers' position, limit, and mark values are independent. The
+     * asFloatBuffer method, for example, creates an instance of the FloatBuffer class
+     * that is backed by the byte buffer upon which the method is invoked. Corresponding
+     * view-creation methods are defined for the types char, short, int, long, and double.
+     *
+     * View buffers have two important advantages over the families of type-specific
+     * get and put methods described above:
+     *
+     *   A view buffer is indexed not in terms of bytes but rather in terms of the
+     *   type-specific size of its values;
+     *
+     *   A view buffer provides relative bulk get and put methods that can transfer
+     *   contiguous sequences of values between a buffer and an array or some other
+     *   buffer of the same type; and
+     *
+     */
+    class DECAF_API ByteBuffer : public Buffer {
+    public:
+
+        ByteBuffer();
+        virtual ~ByteBuffer();
+
+    };
+
+}}
+
+#endif /*_DECAF_NIO_BYTEBUFFER_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h Mon Nov 12
12:49:15 2007
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_INVALIDMARKEXCEPTION_H_
+#define _DECAF_NIO_INVALIDMARKEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/exceptions/IllegalStateException.h>
+
+namespace decaf{
+namespace nio{
+
+    class DECAF_API InvalidMarkException : public lang::exceptions::IllegalStateException
{
+    public:
+
+        /**
+         * Default Constructor
+         */
+        InvalidMarkException() throw() {}
+
+        /**
+         * Conversion Constructor from some other Exception
+         * @param An exception that should become this type of Exception
+         */
+        InvalidMarkException( const lang::Exception& ex ) throw()
+        : lang::exceptions::IllegalStateException() {
+            *(lang::Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        InvalidMarkException( const InvalidMarkException& ex ) throw()
+        : lang::exceptions::IllegalStateException() {
+            *(lang::Exception*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        BindException( const char* file, const int lineNumber,
+                            const char* msg, ... ) throw ()
+        : lang::exceptions::IllegalStateException() {
+
+            va_list vargs ;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
+
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual InvalidMarkException* clone() const {
+            return new InvalidMarkException( *this );
+        }
+
+        /**
+         * Destructor
+         */
+        virtual ~InvalidMarkException() throw() {}
+
+    };
+
+}}
+
+#endif /*_DECAF_NIO_INVALIDMARKEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/InvalidMarkException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h?rev=594294&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h Mon Nov
12 12:49:15 2007
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_NIO_READONLYBUFFEREXCEPTION_H_
+#define _DECAF_NIO_READONLYBUFFEREXCEPTION_H_
+
+namespace decaf{
+namespace nio{
+
+    class ReadOnlyBufferException {
+    public:
+
+        ReadOnlyBufferException() {}
+        virtual ~ReadOnlyBufferException() {}
+    };
+
+}}
+
+#endif /*_DECAF_NIO_READONLYBUFFEREXCEPTION_H_*/

Propchange: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ReadOnlyBufferException.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message