SubscriptionParameter.h
Go to the documentation of this file.00001
00002
00003 #ifndef SUBSCRIPTION_PARAMETER_H_
00004 #define SUBSCRIPTION_PARAMETER_H_
00005
00006 #include <fesa-core/Core/FesaDefs.h>
00007
00008 #include <string>
00009 #include <vector>
00010 #include <sstream>
00011 #include <boost/shared_ptr.hpp>
00012
00013 class rdaData;
00014 class rdaValueChangeListener;
00015
00016 namespace fesa
00017 {
00018
00019 class AbstractSubscriptionFilter;
00020 class AbstractDevice;
00021 class Property;
00022 class NotificationThread;
00023 class MultiplexingContext;
00024
00030 class SubscriptionParameter
00031 {
00032 public:
00033 SubscriptionParameter(const std::string& paramName, AbstractDevice& device, Property& property, bool useFastUpdate, NotificationThread* pNotificationThread);
00034
00035 ~SubscriptionParameter();
00036
00037 void notify(MultiplexingContext& muxContext, RequestType& reqType, std::vector<std::string>& validCS);
00038
00039 void addSubscriber(const std::string& cycleSelector, const rdaData& filter, rdaValueChangeListener* subscriber);
00040
00041 void removeSubscriber(const std::string& cycleSelector, rdaValueChangeListener* subscriber, bool& isEmpty);
00042
00043 const std::string& getName();
00044
00045 Property& getProperty();
00046
00047 AbstractDevice& getDevice();
00048
00049 void reportInternalError(const std::string& errorCategory, int32_t errorCode, const std::string& message, bool changed);
00050
00051 void printDebugState(std::stringstream& str);
00052
00053 private:
00054
00058 typedef std::vector<boost::shared_ptr<AbstractSubscriptionFilter> > SubscriptionFilterVector;
00059 typedef SubscriptionFilterVector::iterator SubscriptionFilterItr;
00060 SubscriptionFilterVector filters_;
00061
00065 std::string name_;
00066
00070 AbstractDevice& device_;
00071
00075 Property& property_;
00076
00080 bool useFastUpdate_;
00081
00085 NotificationThread* pNotificationThread_;
00086 };
00087
00088 inline const std::string& SubscriptionParameter::getName()
00089 {
00090 return name_;
00091 }
00092
00093 inline Property& SubscriptionParameter::getProperty()
00094 {
00095 return property_;
00096 }
00097
00098 inline AbstractDevice& SubscriptionParameter::getDevice()
00099 {
00100 return device_;
00101 }
00102
00103 }
00104
00105 #endif // SUBSCRIPTION_PARAMETER_H_