activemq-cpp-3.9.5
ActiveMQStreamMessage.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
19 #define _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
20 
21 #include <activemq/util/Config.h>
24 #include <cms/StreamMessage.h>
32 #include <string>
33 #include <memory>
34 
35 namespace activemq {
36 namespace commands {
37 
38  class ActiveMQStreamMessageImpl;
39 
40  class AMQCPP_API ActiveMQStreamMessage: public ActiveMQMessageTemplate<cms::StreamMessage> {
41  private:
42 
43  ActiveMQStreamMessageImpl* impl;
44 
45  mutable std::auto_ptr<decaf::io::DataInputStream> dataIn;
46  mutable std::auto_ptr<decaf::io::DataOutputStream> dataOut;
47 
48  public:
49 
50  const static unsigned char ID_ACTIVEMQSTREAMMESSAGE;
51 
52  private:
53 
56 
57  public:
58 
60 
61  virtual ~ActiveMQStreamMessage() throw ();
62 
63  virtual unsigned char getDataStructureType() const;
64 
65  virtual ActiveMQStreamMessage* cloneDataStructure() const;
66 
67  virtual void copyDataStructure(const DataStructure* src);
68 
69  virtual std::string toString() const;
70 
71  virtual bool equals(const DataStructure* value) const;
72 
73  virtual void onSend();
74 
75  public: // CMS Message
76 
77  virtual cms::StreamMessage* clone() const;
78 
79  virtual void clearBody();
80 
81  public: // CMS Stream Message
82 
83  virtual ValueType getNextValueType() const;
84 
85  virtual void reset();
86 
87  virtual bool readBoolean() const;
88 
89  virtual void writeBoolean(bool value);
90 
91  virtual unsigned char readByte() const;
92 
93  virtual void writeByte(unsigned char value);
94 
95  virtual int readBytes(std::vector<unsigned char>& value) const;
96 
97  virtual void writeBytes(const std::vector<unsigned char>& value);
98 
99  virtual int readBytes(unsigned char* buffer, int length) const;
100 
101  virtual void writeBytes(const unsigned char* value, int offset, int length);
102 
103  virtual char readChar() const;
104 
105  virtual void writeChar(char value);
106 
107  virtual float readFloat() const;
108 
109  virtual void writeFloat(float value);
110 
111  virtual double readDouble() const;
112 
113  virtual void writeDouble(double value);
114 
115  virtual short readShort() const;
116 
117  virtual void writeShort(short value);
118 
119  virtual unsigned short readUnsignedShort() const;
120 
121  virtual void writeUnsignedShort(unsigned short value);
122 
123  virtual int readInt() const;
124 
125  virtual void writeInt(int value);
126 
127  virtual long long readLong() const;
128 
129  virtual void writeLong(long long value);
130 
131  virtual std::string readString() const;
132 
133  virtual void writeString(const std::string& value);
134 
135  private:
136 
137  void storeContent();
138 
139  void initializeReading() const;
140 
141  void initializeWriting();
142 
143  };
144 
145 }}
146 
147 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_*/
ValueType
Defines the Type Identifiers used to identify the type contained within a specific Message property o...
Definition: Message.h:112
#define AMQCPP_API
Definition: Config.h:30
Definition: ActiveMQStreamMessage.h:40
Definition: DataStructure.h:27
static const unsigned char ID_ACTIVEMQSTREAMMESSAGE
Definition: ActiveMQStreamMessage.h:50
#define const
Definition: zconf.h:198
Definition: ActiveMQMessageTemplate.h:41