NotificationID.cpp

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 
00003 #include <fesa-core/Core/NotificationID.h>
00004 
00005 #include <cmw-log/Logger.h>
00006 
00007 #include <iostream>
00008 
00009 namespace
00010 {
00011 CMW::Log::Logger& logger = CMW::Log::LoggerFactory::getLogger("FESA.FWK.fesa-core.Core.NotificationID");
00012 }
00013 
00014 
00015 namespace fesa
00016 {
00017 
00018 NotificationID::NotificationID(uint32_t idKey, const std::string& className,
00019                                const std::set<std::string>& deviceCol, const std::set<std::string>& notifiedPropertyCol) :
00020     idKey_(idKey),
00021     className_(className),
00022     deviceCol_(deviceCol),
00023     notifiedPropertyCol_(notifiedPropertyCol)
00024 {
00025 }
00026 
00027 NotificationID::~NotificationID()
00028 {
00029 }
00030 
00031 bool NotificationID::contains(const std::string& propName, const std::string& deviceName)
00032 {
00033     std::set<std::string>::iterator itr;
00034     std::ostringstream msg;
00035     msg << "NotifiedProp Col: ";
00036     for(itr=notifiedPropertyCol_.begin(); itr!=notifiedPropertyCol_.end(); ++itr)
00037     {
00038         msg << *itr << " ";
00039     }
00040     msg << "; DeviceCol: ";
00041     for(itr=deviceCol_.begin(); itr!=deviceCol_.end(); ++itr)
00042     {
00043         msg << *itr << " ";
00044     }
00045     LOG_DEBUG_IF(logger, msg.str());
00046     if (notifiedPropertyCol_.end() != notifiedPropertyCol_.find(propName) && deviceCol_.end() != deviceCol_.find(
00047             deviceName))
00048     {
00049         return true;
00050     }
00051     else
00052     {
00053         return false;
00054     }
00055 }
00056 
00057 } // fesa

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1