00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 #ifndef EVENTCONFIGURATIONELEMENT_H_ 00003 #define EVENTCONFIGURATIONELEMENT_H_ 00004 00005 #include <boost/shared_ptr.hpp> 00006 #include <boost/enable_shared_from_this.hpp> 00007 #include <vector> 00008 #include <string> 00009 00010 namespace fesa 00011 { 00012 00013 class LogicalEventElement; 00014 class ParserElementFactory; 00015 class EventElement; 00016 class ElementXML; 00017 class AbstractDevice; 00018 class AbstractDeviceClass; 00019 00024 class EventConfigurationElement: public boost::enable_shared_from_this<EventConfigurationElement> 00025 { 00026 public: 00027 00031 EventConfigurationElement(boost::shared_ptr<LogicalEventElement> parent); 00032 00033 virtual ~EventConfigurationElement(); 00034 00038 virtual void initialize(const std::string& xpath,ElementXML* eventConfigurationElement, ParserElementFactory& parserElementFactory); 00039 00043 virtual void addDeviceRef(AbstractDevice* device); 00044 00045 virtual std::vector<boost::shared_ptr<EventElement> > getEventElementCol() const; 00046 00047 virtual std::string getName() const; 00048 00049 virtual AbstractDeviceClass* getClassRef() const; 00050 virtual const std::string& getLogicalEventName() const; 00051 00055 virtual bool isNotUsed() const; 00056 00057 protected: 00058 00062 EventConfigurationElement(); 00063 00064 private: 00065 00069 std::string loadAttribute(const std::string& xpath, ElementXML* element,const std::string& attributeName); 00070 00074 void loadEventSourceElement(const std::string& xpath,ElementXML* eventConfigurationElement, ParserElementFactory& parserElementFactory); 00075 00079 void loadEventElements(const std::string& xpath,ElementXML* logicalEventElement,const std::string& eventSource, ParserElementFactory& parserElementFactory); 00080 00081 std::vector<boost::shared_ptr<EventElement> > eventElementCol_; 00082 00083 std::vector<AbstractDevice*> deviceCol_; 00084 00088 boost::shared_ptr<LogicalEventElement> parentLogicalEventElement_; 00089 00090 std::string eventConfigurationName_; 00091 00095 bool isInitialized_; 00096 }; 00097 00098 } //end namespace 00099 00100 00101 #endif /* EVENTCONFIGURATIONELEMENT_H_ */