00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #ifndef ON_SUBSCRIPTION_RT_EVENT_PAYLOAD_H_ 00004 #define ON_SUBSCRIPTION_RT_EVENT_PAYLOAD_H_ 00005 00006 #include <fesa-core/RealTime/RTEventPayload.h> 00007 00008 #include <cmw-rda/Data.h> 00009 00010 #include <string> 00011 00012 namespace fesa 00013 { 00014 00019 class OnSubscriptionRTEventPayload : public RTEventPayload 00020 { 00021 public: 00028 OnSubscriptionRTEventPayload(std::string& deviceName, 00029 std::string& propertyName, std::string&cycleSelectorName, rdaData& data); 00030 00034 std::string getDeviceName(); 00035 00039 std::string getPropertyName(); 00040 00044 std::string getCycleSelectorName(); 00045 00051 template<class T> void getValue(T& data); 00052 00053 private: 00054 00059 std::string deviceName_; 00064 std::string propertyName_; 00069 std::string cycleSelectorName_; 00070 00075 rdaData rdaData_; 00076 friend class OnSubscriptionEventSource; 00077 }; 00078 00079 template<class T> inline void OnSubscriptionRTEventPayload::getValue(T& data) 00080 { 00081 data.setData(rdaData_, false, false); 00082 } 00083 00084 } // fesa 00085 00086 #endif // ON_SUBSCRIPTION_RT_EVENT_PAYLOAD_H_