RTController.h
Go to the documentation of this file.00001
00002
00003 #ifndef RT_CONTROLLER_H_
00004 #define RT_CONTROLLER_H_
00005
00006 #include <fesa-core/RealTime/AbstractRTDeviceClass.h>
00007 #include <fesa-core/RealTime/AbstractRTEquipment.h>
00008
00009 #include <string>
00010 #include <map>
00011 #include <vector>
00012 #include <stdint.h>
00013
00014 #include <boost/scoped_ptr.hpp>
00015 #include <boost/shared_ptr.hpp>
00016
00017 namespace fesa
00018 {
00019
00020 class FesaStream;
00021 class RTScheduler;
00022 class RTLayerInfo;
00023 class AbstractRTDeviceClass;
00024 class EventElement;
00025 class AbstractEventSourceFactory;
00026 class RTSchedulingUnitRef;
00027 class EventsMappingLoader;
00028 class AbstractRTAction;
00029 struct RTActionConfig;
00030
00031
00039 class RTController
00040 {
00041
00042 public:
00046 RTController();
00047
00051 virtual ~RTController();
00052
00056 void start();
00057
00063 void printConfigAll(FesaStream* fesaStream);
00064
00070 void printStateAll(FesaStream* fesaStream, double elapsedTime);
00071
00077 void initialize();
00078
00079 protected:
00084 std::map<const std::string, RTScheduler*> schedulersCol_;
00085
00086 private:
00087
00092 void createSchedulers(std::vector<RTLayerInfo*>& layerInfoCol, AbstractRTDeviceClass* pRTDeviceClass,
00093 const std::string instanceFile);
00094
00098 void createRTActionConfig(AbstractRTEquipment::RTLayerInfoCol& layerInfoCol, AbstractRTDeviceClass* pRTDeviceClass,
00099 RTSchedulingUnitInfo* schedulingUnit, AbstractRTDeviceClass::RTActionInfoCol& actionInfoCol, EventsMappingLoader& eventsManager);
00100
00104 RTScheduler* createAction(AbstractRTEquipment::RTLayerInfoCol& layerInfoCol, AbstractRTDeviceClass* pRTDeviceClass,
00105 RTSchedulingUnitInfo* schedulingUnit, RTActionConfig& actionConfig, std::set<AbstractDevice*>* deviceCollection);
00106
00110 RTScheduler* findScheduler(const std::string& schedulerName, uint32_t queueSize);
00111
00118 void createEventSource(const std::string& eventSourceName, boost::shared_ptr<fesa::EventElement>& element,
00119 RTScheduler* currentScheduler, AbstractEventSourceFactory* eventSourceFactory);
00120
00124 void assertSchedulingUnitsConfig(const std::vector<RTSchedulingUnitRef> schedulingUnits);
00125
00126 std::vector<std::string> schedulingUnitWithEmptyDevCol_;
00127 };
00128
00129 }
00130
00131 #endif // RT_CONTROLLER_H_