activemq-cpp-3.4.0

src/main/cms/BytesMessage.h

Go to the documentation of this file.
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 _CMS_BYTESMESSAGE_H_
00019 #define _CMS_BYTESMESSAGE_H_
00020 
00021 #include <cms/Config.h>
00022 #include <cms/Message.h>
00023 
00024 #include <cms/CMSException.h>
00025 #include <cms/MessageNotReadableException.h>
00026 #include <cms/MessageNotWriteableException.h>
00027 #include <cms/MessageEOFException.h>
00028 #include <cms/MessageFormatException.h>
00029 
00030 namespace cms{
00031 
00066     class CMS_API BytesMessage : public Message{
00067     public:
00068 
00069         virtual ~BytesMessage() throw();
00070 
00082         virtual void setBodyBytes( const unsigned char* buffer, int numBytes ) = 0;
00083 
00096         virtual unsigned char* getBodyBytes() const = 0;
00097 
00106         virtual int getBodyLength() const = 0;
00107 
00115         virtual void reset() = 0;
00116 
00126         virtual bool readBoolean() const = 0;
00127 
00140         virtual void writeBoolean( bool value ) = 0;
00141 
00152         virtual unsigned char readByte() const = 0;
00153 
00164         virtual void writeByte( unsigned char value ) = 0;
00165 
00190         virtual int readBytes( std::vector<unsigned char>& value ) const = 0;
00191 
00203         virtual void writeBytes( const std::vector<unsigned char>& value ) = 0;
00204 
00236         virtual int readBytes( unsigned char* buffer, int length ) const = 0;
00237 
00253         virtual void writeBytes( const unsigned char* value, int offset, int length ) = 0;
00254 
00265         virtual char readChar() const = 0;
00266 
00277         virtual void writeChar( char value ) = 0;
00278 
00289         virtual float readFloat() const = 0;
00290 
00300         virtual void writeFloat( float value ) = 0;
00301 
00312         virtual double readDouble() const = 0;
00313 
00323         virtual void writeDouble( double value ) = 0;
00324 
00335         virtual short readShort() const = 0;
00336 
00347         virtual void writeShort( short value ) = 0;
00348 
00359         virtual unsigned short readUnsignedShort() const = 0;
00360 
00371         virtual void writeUnsignedShort( unsigned short value ) = 0;
00372 
00383         virtual int readInt() const = 0;
00384 
00395         virtual void writeInt( int value ) = 0;
00396 
00407         virtual long long readLong() const = 0;
00408 
00419         virtual void writeLong( long long value ) = 0;
00420 
00431         virtual std::string readString() const = 0;
00432 
00443         virtual void writeString( const std::string& value ) = 0;
00444 
00455         virtual std::string readUTF() const = 0;
00456 
00467         virtual void writeUTF( const std::string& value ) = 0;
00468 
00476         virtual BytesMessage* clone() const = 0;
00477 
00478    };
00479 }
00480 
00481 #endif /*_CMS_BYTESMESSAGE_H_*/