EventElement.cpp

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 #include <fesa-core/Utilities/ParserElements/EventElement.h>
00003 #include <fesa-core/Utilities/ParserElements/EventConfigurationElement.h>
00004 #include <fesa-core/DataStore/AbstractDevice.h>
00005 #include <fesa-core/Utilities/XMLParser.h>
00006 
00007 namespace fesa
00008 {
00009 
00010 EventElement::EventElement(boost::shared_ptr<EventConfigurationElement> parent,const EventSourceType sourceType):
00011                 isInitialized_(false), eventSourceType_(sourceType), parentEventConfigurationElement_(parent)
00012 {
00013 
00014 }
00015 
00016 EventElement::EventElement()
00017 {
00018 
00019 }
00020 
00021 EventElement::~EventElement()
00022 {
00023 
00024 }
00025 
00026 const std::string& EventElement::getLogicalName() const
00027 {
00028         return parentEventConfigurationElement_->getLogicalEventName();
00029 }
00030 
00031 const EventSourceType& EventElement::getEventSourceType() const
00032 {
00033         return eventSourceType_;
00034 }
00035 
00036 void EventElement::addDeviceRef(AbstractDevice* device)
00037 {
00038         if(!isInitialized_)
00039                 throw FesaException(__FILE__, __LINE__, FesaErrorParserElementNotInitialized.c_str());
00040 
00041         if(device == NULL)
00042                 throw FesaException(__FILE__, __LINE__, FesaErrorNULLPointer.c_str());
00043 
00044         deviceCol_.insert(device);
00045 }
00046 
00047 const std::string& EventElement::getEventSourceName() const
00048 {
00049         if(!isInitialized_)
00050                 throw FesaException(__FILE__, __LINE__, FesaErrorParserElementNotInitialized.c_str());
00051 
00052         return eventSourceName_;
00053 }
00054 
00055 const std::string& EventElement::getConcreteName() const
00056 {
00057         if(!isInitialized_)
00058                 throw FesaException(__FILE__, __LINE__, FesaErrorParserElementNotInitialized.c_str());
00059 
00060         return concreteEventName_;
00061 }
00062 
00063 const std::set<AbstractDevice*>& EventElement::getDeviceCollection() const
00064 {
00065         if(!isInitialized_)
00066                 throw FesaException(__FILE__, __LINE__, FesaErrorParserElementNotInitialized.c_str());
00067 
00068         return deviceCol_;
00069 }
00070 
00071 }

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1