TimerEventElement.cpp

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 #include <fesa-core/Utilities/ParserElements/TimerEventElement.h>
00003 #include <fesa-core/Utilities/ParserElements/EventConfigurationElement.h>
00004 #include <fesa-core/Utilities/ParserElements/ParserElementDefs.h>
00005 #include <fesa-core/Utilities/XMLParser.h>
00006 
00007 namespace fesa
00008 {
00009 
00010 TimerEventElement::TimerEventElement(boost::shared_ptr<EventConfigurationElement> parent):
00011         EventElement(parent,TimerSource)
00012 {
00013 }
00014 
00015 TimerEventElement::~TimerEventElement()
00016 {
00017 
00018 }
00019 
00020 void TimerEventElement::initialize(const std::string& xpath,ElementXML* eventElement)
00021 {
00022         eventSourceName_ = TIMER_EVENT_SOURCE_TAG;
00023         std::vector<AttributeXML*>::iterator iter;
00024         for(iter=eventElement->attributeList_.begin();iter!=eventElement->attributeList_.end();++iter)
00025         {
00026                 if((*iter)->name_ == TIMER_TAG_PERIOD)
00027                 {
00028                         period_ = (*iter)->value_;
00029                 }
00030         }
00031         concreteEventName_ = eventSourceName_ + "::" + period_;
00032         isInitialized_ = true;
00033 }
00034 
00035 const std::string& TimerEventElement::getSourceTypeSpecificData(const std::string& dataTag)
00036 {
00037         if( dataTag == TIMER_TAG_PERIOD )
00038         {
00039                 return period_;
00040         }
00041 
00042         //Not found
00043         throw FesaException(__FILE__, __LINE__, FesaErrorUnkonwDataToken.c_str(),dataTag.c_str(),getLogicalName().c_str());
00044 }
00045 
00046 }

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1