activemq-cpp-3.8.2
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 = 27;
51 
52  private:
53 
56 
57  public:
58 
60  virtual ~ActiveMQStreamMessage() throw ();
61 
62  virtual unsigned char getDataStructureType() const;
63 
64  virtual ActiveMQStreamMessage* cloneDataStructure() const;
65 
66  virtual void copyDataStructure(const DataStructure* src);
67 
68  virtual std::string toString() const;
69 
70  virtual bool equals(const DataStructure* value) const;
71 
72  virtual void onSend();
73 
74  public: // CMS Message
75 
76  virtual cms::StreamMessage* clone() const {
77  ActiveMQStreamMessage* clone = this->cloneDataStructure();
78  clone->setReadOnlyBody(false);
79  clone->setReadOnlyProperties(false);
80  return dynamic_cast<cms::StreamMessage*>(clone);
81  }
82 
83  virtual void clearBody();
84 
85  public: // CMS Stream Message
86 
87  virtual ValueType getNextValueType() const;
88 
89  virtual void reset();
90 
91  virtual bool readBoolean() const;
92 
93  virtual void writeBoolean(bool value);
94 
95  virtual unsigned char readByte() const;
96 
97  virtual void writeByte(unsigned char value);
98 
99  virtual int readBytes(std::vector<unsigned char>& value) const;
100 
101  virtual void writeBytes(const std::vector<unsigned char>& value);
102 
103  virtual int readBytes(unsigned char* buffer, int length) const;
104 
105  virtual void writeBytes(const unsigned char* value, int offset, int length);
106 
107  virtual char readChar() const;
108 
109  virtual void writeChar(char value);
110 
111  virtual float readFloat() const;
112 
113  virtual void writeFloat(float value);
114 
115  virtual double readDouble() const;
116 
117  virtual void writeDouble(double value);
118 
119  virtual short readShort() const;
120 
121  virtual void writeShort(short value);
122 
123  virtual unsigned short readUnsignedShort() const;
124 
125  virtual void writeUnsignedShort(unsigned short value);
126 
127  virtual int readInt() const;
128 
129  virtual void writeInt(int value);
130 
131  virtual long long readLong() const;
132 
133  virtual void writeLong(long long value);
134 
135  virtual std::string readString() const;
136 
137  virtual void writeString(const std::string& value);
138 
139  private:
140 
141  void storeContent();
142 
143  void initializeReading() const;
144 
145  void initializeWriting();
146 
147  };
148 
149 }}
150 
151 #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: ArrayPointer.h:432
Definition: DataStructure.h:27
Interface for a StreamMessage.
Definition: StreamMessage.h:61
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: DestinationResolver.h:23
void setReadOnlyBody(bool value)
Set the Read Only State of the Message Content.
Definition: Message.h:270
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
#define const
Definition: zconf.h:198
Definition: ActiveMQMessageTemplate.h:41
void setReadOnlyProperties(bool value)
Set the Read Only State of the Message Properties.
Definition: Message.h:254