00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #ifndef NOTIFICATION_ID_MANAGER_H_ 00004 #define NOTIFICATION_ID_MANAGER_H_ 00005 00006 #include <string> 00007 #include <set> 00008 #include <map> 00009 00010 #include <stdint.h> 00011 00012 namespace fesa 00013 { 00014 00015 class NotificationID; 00016 00019 const std::string NOTIFICATION_ID_COLLECTION_TAG = "notification-id-collection"; 00020 00025 class NotificationIDManager 00026 { 00027 public: 00028 00033 void save(); 00034 00042 uint32_t createNotificationID(const std::set<std::string>& notifiedProperties, 00043 const std::set<std::string>& deviceNames, const std::string& classname); 00044 00049 static NotificationIDManager* getInstance(); 00050 00057 const std::map<uint32_t, NotificationID*>& getNotificationIDCol(); 00058 00059 private: 00060 00065 static void releaseInstance(); 00066 00070 friend class AbstractEquipment; 00071 00076 std::map<uint32_t, NotificationID*> notificationIDCol_; 00077 00081 static NotificationIDManager* theInstance_; 00082 00086 NotificationIDManager(); 00087 00091 NotificationIDManager(const NotificationIDManager& other); 00092 00096 NotificationIDManager& operator=(const NotificationIDManager& other); 00097 00101 ~NotificationIDManager(); 00102 00106 void storeNotificationIDCollection(); 00107 00111 void loadNotificationIDCollection(); 00112 00116 void load(); 00117 }; 00118 00119 } // fesa 00120 00121 #endif // NOTIFICATION_ID_MANAGER_H_