CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/EventFilter/Modules/src/ShmOutputModuleRegistry.cc

Go to the documentation of this file.
00001 #include "EventFilter/Modules/interface/ShmOutputModuleRegistry.h"
00002 #include "EventFilter/Modules/src/FUShmOutputModule.h"
00003 
00004 #include <iostream>
00005 
00006 namespace evf{
00007 
00008   ShmOutputModuleRegistry::ShmOutputModuleRegistry(const edm::ParameterSet &ps){
00009   }
00010 
00011   void ShmOutputModuleRegistry::registerModule(std::string &name, OutputModule *op)
00012   {
00013     clm_.insert(std::pair<std::string, OutputModule*>(name,op));
00014   }
00015   
00016 
00017   OutputModule* ShmOutputModuleRegistry::get(std::string &name)
00018   {
00019     OutputModule* retval = 0;
00020     idct it= clm_.find(name);
00021     if(it!=clm_.end())
00022       retval = (it->second);
00023     return retval;
00024   }
00025   void ShmOutputModuleRegistry::dumpRegistry(){
00026     idct it= clm_.begin();
00027     while(it!=clm_.end()){
00028       std::cout << "name " << it->first << "add " 
00029                 << (unsigned long)(it->second) << std::endl;
00030       it++;
00031     }
00032   }
00033   std::vector<edm::FUShmOutputModule *> ShmOutputModuleRegistry::getShmOutputModules()
00034   {
00035     std::vector<edm::FUShmOutputModule *> outputs;
00036     idct it= clm_.begin();
00037     while(it!=clm_.end()){
00038       edm::FUShmOutputModule * sho = dynamic_cast<edm::FUShmOutputModule *> ((*it).second);
00039       if (sho!=NULL) {
00040         outputs.push_back(sho);
00041       }
00042       it++;
00043     }
00044     return outputs;
00045   }
00046   void ShmOutputModuleRegistry::clear()
00047   {
00048      clm_.clear();
00049   }
00050 
00051 
00052 } //end namespace evf