00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #ifndef NOTIFICATION_H_ 00004 #define NOTIFICATION_H_ 00005 00006 #include <fesa-core/RDADeviceServer/SubscriptionCycle.h> 00007 #include <fesa-core/Core/FesaDefs.h> 00008 00009 #include <string> 00010 #include <map> 00011 #include <sstream> 00012 #include <boost/shared_ptr.hpp> 00013 00014 namespace fesa 00015 { 00016 00017 class SubscriptionParameter; 00018 class NotificationID; 00019 class MultiplexingContext; 00020 00027 class Notification 00028 { 00029 public: 00034 Notification(NotificationID& id); 00035 00042 void notify(MultiplexingContext& muxContext, RequestType& reqType); 00043 00049 void addSubscriber(boost::shared_ptr<SubscriptionParameter> sp); 00050 00055 void addCycle(const std::string& cycleSelector); 00056 00062 void removeSubscriber(boost::shared_ptr<SubscriptionParameter> sp, const std::string& cycleSelector, bool toBeDeleted); 00063 00070 bool contains(const std::string& deviceName, const std::string& propName); 00071 00072 void printDebugState(std::stringstream& str); 00073 00074 private: 00076 NotificationID& id_; 00077 00081 typedef std::map<std::string, boost::shared_ptr<SubscriptionParameter> > SubscriptionMap; 00082 typedef SubscriptionMap::iterator SubscriptionItr; 00083 SubscriptionMap subscriptions_; 00084 00085 SubscriptionCycle subscriptionCycle_; 00086 }; 00087 00088 } // fesa 00089 00090 #endif // NOTIFICATION_H_