Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Properties.h

Go to the documentation of this file.
00001 #ifndef PROPERTIES_H 00002 #define PROPERTIES_H 00003 00004 #include <map> 00005 #include <string> 00006 #include <vector> 00007 #include <memory> 00008 #include <stdexcept> 00009 00010 namespace acsalarm 00011 { 00012 typedef std::map< std::string, std::string >::value_type PropertyMapEntryType; 00013 00014 /* 00015 * Utility class containing a collection of properties, which are name/value pairs of strings. 00016 */ 00017 class Properties 00018 { 00019 private: 00020 00021 std::map<std::string, std::string> propertiesMap; 00022 00023 public: 00024 00025 // constructors 00026 Properties(); 00027 Properties(const Properties &); 00028 00029 // destructor 00030 virtual ~Properties(); 00031 00032 // assignment operator 00033 Properties & operator=(const Properties & rhs); 00034 00035 // equality operator 00036 int operator==(const Properties &rhs) const; 00037 00038 //Searches for the property with the specified key in this property list. 00039 std::string getProperty(std::string key); 00040 00041 // Returns an enumeration of all the keys in this property list, 00042 // including distinct keys in the default property list if a key 00043 // of the same name has not already been found from the main properties list. 00044 std::auto_ptr<std::vector<std::string> > propertyNames(); 00045 00046 // Calls the map method put. 00047 void setProperty(std::string key, std::string value) throw(std::invalid_argument); 00048 00049 // Returns an XML fragment (NOT a complete document) representing all of 00050 // the properties contained in this table, for use in the message transported 00051 // from an alarm source to the alarm server. 00052 // @param amountToIndent - used to specify a level of indentation (in spaces) for readability 00053 std::string toXML(int amountToIndent = 6); 00054 }; 00055 } 00056 #endif

Generated on Thu Apr 30 02:30:52 2009 for ACS C++ API by doxygen 1.3.8