activemq-cpp-3.9.5
MapMessage.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 _CMS_MAPMESSAGE_H_
19#define _CMS_MAPMESSAGE_H_
20
21#include <cms/Config.h>
22#include <cms/Message.h>
23
24#include <cms/CMSException.h>
27
28namespace cms {
29
71 class CMS_API MapMessage: public Message {
72 public:
73
74 virtual ~MapMessage();
75
83 virtual bool isEmpty() const = 0;
84
94 virtual std::vector<std::string> getMapNames() const = 0;
95
105 virtual bool itemExists(const std::string& name) const = 0;
106
120 virtual ValueType getValueType(const std::string& key) const = 0;
121
131 virtual bool getBoolean(const std::string& name) const = 0;
132
144 virtual void setBoolean(const std::string& name, bool value) = 0;
145
155 virtual unsigned char getByte(const std::string& name) const = 0;
156
168 virtual void setByte(const std::string& name, unsigned char value) = 0;
169
179 virtual std::vector<unsigned char> getBytes(const std::string& name) const = 0;
180
192 virtual void setBytes(const std::string& name, const std::vector<unsigned char>& value) = 0;
193
203 virtual char getChar(const std::string& name) const = 0;
204
216 virtual void setChar(const std::string& name, char value) = 0;
217
227 virtual double getDouble(const std::string& name) const = 0;
228
240 virtual void setDouble(const std::string& name, double value) = 0;
241
251 virtual float getFloat(const std::string& name) const = 0;
252
264 virtual void setFloat(const std::string& name, float value) = 0;
265
275 virtual int getInt(const std::string& name) const = 0;
276
288 virtual void setInt(const std::string& name, int value) = 0;
289
299 virtual long long getLong(const std::string& name) const = 0;
300
312 virtual void setLong(const std::string& name, long long value) = 0;
313
323 virtual short getShort(const std::string& name) const = 0;
324
336 virtual void setShort(const std::string& name, short value) = 0;
337
347 virtual std::string getString(const std::string& name) const = 0;
348
360 virtual void setString(const std::string& name, const std::string& value) = 0;
361
362 };
363
364}
365
366#endif /*_CMS_MAPMESSAGE_H_*/
A MapMessage object is used to send a set of name-value pairs.
Definition MapMessage.h:71
virtual std::vector< std::string > getMapNames() const =0
Returns an Enumeration of all the names in the MapMessage object.
virtual void setBytes(const std::string &name, const std::vector< unsigned char > &value)=0
Sets a Bytes value with the specified name into the Map.
virtual void setBoolean(const std::string &name, bool value)=0
Sets a boolean value with the specified name into the Map.
virtual long long getLong(const std::string &name) const =0
Returns the Long value of the Specified name.
virtual double getDouble(const std::string &name) const =0
Returns the Double value of the Specified name.
virtual std::string getString(const std::string &name) const =0
Returns the String value of the Specified name.
virtual bool itemExists(const std::string &name) const =0
Indicates whether an item exists in this MapMessage object.
virtual void setByte(const std::string &name, unsigned char value)=0
Sets a Byte value with the specified name into the Map.
virtual short getShort(const std::string &name) const =0
Returns the Short value of the Specified name.
virtual unsigned char getByte(const std::string &name) const =0
Returns the Byte value of the Specified name.
virtual float getFloat(const std::string &name) const =0
Returns the Float value of the Specified name.
virtual void setString(const std::string &name, const std::string &value)=0
Sets a String value with the specified name into the Map.
virtual void setFloat(const std::string &name, float value)=0
Sets a Float value with the specified name into the Map.
virtual ~MapMessage()
virtual char getChar(const std::string &name) const =0
Returns the Char value of the Specified name.
virtual bool isEmpty() const =0
Returns true if there are no values stored in the MapMessage body.
virtual void setInt(const std::string &name, int value)=0
Sets a Int value with the specified name into the Map.
virtual void setShort(const std::string &name, short value)=0
Sets a Short value with the specified name into the Map.
virtual std::vector< unsigned char > getBytes(const std::string &name) const =0
Returns the Bytes value of the Specified name.
virtual void setLong(const std::string &name, long long value)=0
Sets a Long value with the specified name into the Map.
virtual int getInt(const std::string &name) const =0
Returns the Int value of the Specified name.
virtual bool getBoolean(const std::string &name) const =0
Returns the Boolean value of the Specified name.
virtual ValueType getValueType(const std::string &key) const =0
Returns the value type for the given key mapping.
virtual void setDouble(const std::string &name, double value)=0
Sets a Double value with the specified name into the Map.
virtual void setChar(const std::string &name, char value)=0
Sets a Char value with the specified name into the Map.
Root of all messages.
Definition Message.h:88
ValueType
Defines the Type Identifiers used to identify the type contained within a specific Message property o...
Definition Message.h:112
#define CMS_API
Definition Config.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition DestinationResolver.h:23