activemq-cpp-3.9.5
CMSProperties.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#ifndef _CMS_CMSPROPERTIES_H_
18#define _CMS_CMSPROPERTIES_H_
19
20#include <cms/Config.h>
21
22#include <map>
23#include <string>
24#include <vector>
25
26namespace cms {
27
35 public:
36
37 virtual ~CMSProperties();
38
45 virtual int size() const = 0;
46
52 virtual bool isEmpty() const = 0;
53
62 virtual const char* getProperty(const std::string& name) const = 0;
63
74 virtual std::string getProperty(const std::string& name, const std::string& defaultValue) const = 0;
75
85 virtual void setProperty(const std::string& name, const std::string& value) = 0;
86
94 virtual bool hasProperty(const std::string& name) const = 0;
95
106 virtual std::string remove(const std::string& name) = 0;
107
114 virtual std::vector<std::string> propertyNames() const = 0;
115
123 virtual std::vector< std::pair< std::string, std::string > > toArray() const = 0;
124
131 virtual void copy(const CMSProperties* source) = 0;
132
138 virtual CMSProperties* clone() const = 0;
139
143 virtual void clear() = 0;
144
151 virtual std::string toString() const = 0;
152
153 };
154
155}
156
157#endif /*_CMS_CMSPROPERTIES_H_*/
Interface for a Java-like properties object.
Definition CMSProperties.h:34
virtual void copy(const CMSProperties *source)=0
Copies the contents of the given properties object to this one.
virtual bool hasProperty(const std::string &name) const =0
Check to see if the Property exists in the set.
virtual std::string toString() const =0
Formats the contents of the Properties Object into a string that can be logged, etc.
virtual ~CMSProperties()
virtual const char * getProperty(const std::string &name) const =0
Looks up the value for the given property.
virtual std::string getProperty(const std::string &name, const std::string &defaultValue) const =0
Looks up the value for the given property.
virtual std::string remove(const std::string &name)=0
Removes the property with the given name.
virtual void clear()=0
Clears all properties from the map.
virtual int size() const =0
Returns the current count of all the Properties that are currently stored in the Properties object.
virtual std::vector< std::string > propertyNames() const =0
Returns a vector containing all the names of the properties currently stored in the Properties object...
virtual void setProperty(const std::string &name, const std::string &value)=0
Sets the value for a given property.
virtual CMSProperties * clone() const =0
Clones this object.
virtual std::vector< std::pair< std::string, std::string > > toArray() const =0
Method that serializes the contents of the property map to an array.
virtual bool isEmpty() const =0
Returns true if the properties object is empty.
#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