AbstractAction.h
Go to the documentation of this file.00001
00002 #ifndef ABSTRACTACTION_H_
00003 #define ABSTRACTACTION_H_
00004
00005 #include <fesa-core/Core/AbstractDeviceClass.h>
00006
00007 #include <string>
00008 #include <vector>
00009 #include <map>
00010 #include <boost/shared_ptr.hpp>
00011
00012 namespace fesa
00013 {
00014
00015 class AbstractServiceLocator;
00016 class AbstractDeviceClass;
00017 class MultiplexingContext;
00018 class OnDemandProducer;
00019
00020 class AbstractAction
00021 {
00022 public:
00023 AbstractAction(std::string& actionName, std::string& className, const AbstractServiceLocator* serviceLocator, const std::map<std::string, const AbstractServiceLocator*> serviceLocatorRelatedClasses);
00024 virtual ~AbstractAction();
00025
00026 const std::string& getName();
00027
00028 static const uint32_t DEFAULT_ON_DEMAND_MESSAGE_PRIO = 0;
00029
00030 void triggerOnDemandEventSource(const std::string& sourceName, MultiplexingContext* pCtxt, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO);
00031
00032 void triggerOnDemandEventSource(const std::string& sourceName, MultiplexingContext* pCtxt, const char* payload, uint32_t payloadSize, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO);
00033
00034 void triggerAllOnDemandEventSources(MultiplexingContext* pCtxt, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO);
00035
00036 void triggerAllAutomaticallyTriggeredOnDemandEventSources(MultiplexingContext* pCtxt, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO);
00037
00038 struct OnDemandProducerRef
00039 {
00040 bool triggerAutomatically;
00041 boost::shared_ptr<OnDemandProducer> onDemandProducer;
00042 };
00043
00044 protected:
00045
00049 std::string name_;
00050
00054
00055 std::string className_;
00056
00057 const AbstractServiceLocator* serviceLocator_;
00058
00059 const std::map<std::string, const AbstractServiceLocator*> serviceLocatorRelatedClasses_;
00060
00061 typedef const std::string OnDemandEventSourceName;
00062 typedef std::map< OnDemandEventSourceName,OnDemandProducerRef> OnDemandEventProducerCollection;
00063
00064 OnDemandEventProducerCollection onDemandEventProducerCol_;
00065
00066 };
00067
00068 inline const std::string& AbstractAction::getName()
00069 {
00070 return name_;
00071 }
00072
00073 }
00074 #endif