|
activemq-cpp-3.3.0
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _DECAF_NIO_LONGBUFFER_H_ 00019 #define _DECAF_NIO_LONGBUFFER_H_ 00020 00021 #include <decaf/nio/Buffer.h> 00022 #include <decaf/lang/Comparable.h> 00023 #include <decaf/lang/exceptions/NullPointerException.h> 00024 #include <decaf/lang/exceptions/IndexOutOfBoundsException.h> 00025 #include <decaf/nio/BufferUnderflowException.h> 00026 #include <decaf/nio/BufferOverflowException.h> 00027 #include <decaf/nio/ReadOnlyBufferException.h> 00028 00029 namespace decaf{ 00030 namespace nio{ 00031 00050 class DECAF_API LongBuffer : public Buffer, 00051 public lang::Comparable<LongBuffer> { 00052 protected: 00053 00064 LongBuffer( int capacity ); 00065 00066 public: 00067 00068 virtual ~LongBuffer() {} 00069 00073 virtual std::string toString() const; 00074 00089 virtual long long* array() = 0; 00090 00103 virtual int arrayOffset() = 0; 00104 00122 virtual LongBuffer* asReadOnlyBuffer() const = 0; 00123 00142 virtual LongBuffer& compact() = 0; 00143 00157 virtual LongBuffer* duplicate() = 0; 00158 00167 virtual long long get() = 0; 00168 00180 virtual long long get( int index ) const = 0; 00181 00196 LongBuffer& get( std::vector<long long> buffer ); 00197 00227 LongBuffer& get( long long* buffer, int size, int offset, int length ); 00228 00238 virtual bool hasArray() const = 0; 00239 00260 LongBuffer& put( LongBuffer& src ); 00261 00289 LongBuffer& put( const long long* buffer, int size, int offset, int length ); 00290 00303 LongBuffer& put( std::vector<long long>& buffer ); 00304 00318 virtual LongBuffer& put( long long value ) = 0; 00319 00334 virtual LongBuffer& put( int index, long long value ) = 0; 00335 00349 virtual LongBuffer* slice() const = 0; 00350 00351 public: // Comparable 00352 00356 virtual int compareTo( const LongBuffer& value ) const; 00357 00361 virtual bool equals( const LongBuffer& value ) const; 00362 00366 virtual bool operator==( const LongBuffer& value ) const; 00367 00371 virtual bool operator<( const LongBuffer& value ) const; 00372 00373 public: // Statics 00374 00387 static LongBuffer* allocate( int capacity ); 00388 00413 static LongBuffer* wrap( long long* array, int size, int offset, int length ); 00414 00430 static LongBuffer* wrap( std::vector<long long>& buffer ); 00431 00432 }; 00433 00434 }} 00435 00436 #endif /*_DECAF_NIO_LONGBUFFER_H_*/