activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r595044 - in /activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio: PooledByteBuffer.cpp PooledByteBuffer.h
Date Wed, 14 Nov 2007 20:47:01 GMT
Author: tabish
Date: Wed Nov 14 12:46:59 2007
New Revision: 595044

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

Starting the NIO implementation

Added:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.cpp   (with
props)
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.h   (with
props)

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.cpp?rev=595044&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.cpp (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.cpp Wed
Nov 14 12:46:59 2007
@@ -0,0 +1,41 @@
+/*
+ * 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 "PooledByteBuffer.h"
+
+using namespace decaf;
+using namespace decaf::internal;
+using namespace decaf::internal::nio;
+
+////////////////////////////////////////////////////////////////////////////////
+PooledByteBuffer::PooledByteBuffer( unsigned char* buffer, std::size_t size, bool own ) {
+
+    if( buffer == NULL ) {
+        throw NullPointerException(
+            __FILE__, __LINE__,
+            "PooledByteBuffer::PooledByteBuffer - Passed Buffer is null" );
+    }
+
+    this->buffer = buffer;
+    this->size = size;
+    this->own = own;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+PooledByteBuffer::~PooledByteBuffer() {
+
+}

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

Added: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.h?rev=595044&view=auto
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.h (added)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/nio/PooledByteBuffer.h Wed Nov
14 12:46:59 2007
@@ -0,0 +1,52 @@
+/*
+ * 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_INTERNAL_NIO_POOLEDBYTEBUFFER_H_
+#define _DECAF_INTERNAL_NIO_POOLEDBYTEBUFFER_H_
+
+#include <decaf/lang/exceptions/NullPointerException.h>
+
+namespace decaf{
+namespace internal{
+namespace nio{
+
+    class PooledByteBuffer {
+    private:
+
+        // Buffer to read and write to, may be shared with other instances.
+        unsigned char* buffer;
+
+        // Size of the Buffer
+        std::size_t capacity;
+
+        // Wether this object owns the buffer
+        bool own;
+
+    public:
+
+        /**
+         *
+         * @throws NullPointerException if buffer is NULL
+         */
+        PooledByteBuffer( unsigned char* buffer, std::size_t size, bool own = false );
+        virtual ~PooledByteBuffer();
+
+    };
+
+}}}
+
+#endif /*_DECAF_INTERNAL_NIO_POOLEDBYTEBUFFER_H_*/

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



Mime
View raw message