activemq-cpp-3.6.0
ActiveMQProperties.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_UTIL_ACTIVEMQPROPERTIES_H_
19 #define _ACTIVEMQ_UTIL_ACTIVEMQPROPERTIES_H_
20 
21 #include <map>
22 #include <string>
23 #include <sstream>
24 #include <activemq/util/Config.h>
25 #include <cms/CMSProperties.h>
26 #include <decaf/util/Properties.h>
27 
28 namespace activemq {
29 namespace util {
30 
38  private:
39 
40  decaf::util::Properties properties;
41 
42  public:
43 
45 
46  virtual ~ActiveMQProperties();
47 
49  return this->properties;
50  }
51 
52  virtual const decaf::util::Properties& getProperties() const {
53  return this->properties;
54  }
55 
56  virtual void setProperties(decaf::util::Properties& props) {
57  this->properties = props;
58  }
59 
60  virtual int size() const {
61  return properties.size();
62  }
63 
64  virtual bool isEmpty() const {
65  return properties.isEmpty();
66  }
67 
68  virtual const char* getProperty(const std::string& name) const {
69  return properties.getProperty(name);
70  }
71 
72  virtual std::string getProperty(const std::string& name, const std::string& defaultValue) const {
73  return properties.getProperty(name, defaultValue);
74  }
75 
76  virtual void setProperty(const std::string& name, const std::string& value) {
77  properties.setProperty(name, value);
78  }
79 
80  virtual bool hasProperty(const std::string& name) const {
81  return properties.hasProperty(name);
82  }
83 
84  virtual std::string remove(const std::string& name) {
85  return properties.remove(name);
86  }
87 
88  virtual std::vector<std::string> propertyNames() const {
89  return properties.propertyNames();
90  }
91 
92  virtual std::vector<std::pair<std::string, std::string> > toArray() const {
93  return properties.toArray();
94  }
95 
96  virtual void copy(const CMSProperties* source);
97 
98  virtual CMSProperties* clone() const;
99 
100  virtual void clear() {
101  properties.clear();
102  }
103 
104  virtual std::string toString() const {
105  return properties.toString();
106  }
107 
108  };
109 
110 }}
111 
112 #endif /*_ACTIVEMQ_UTIL_ACTIVEMQPROPERTIES_H_*/