CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/FWCore/Framework/src/ScheduleInfo.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Framework
00004 // Class  :     ScheduleInfo
00005 // 
00006 // Implementation:
00007 //     [Notes on implementation]
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Thu Jul 15 19:40:14 CEST 2010
00011 // $Id: ScheduleInfo.cc,v 1.1 2010/07/22 15:00:28 chrjones Exp $
00012 //
00013 
00014 // system include files
00015 #include <algorithm>
00016 #include <iterator>
00017 #include <boost/bind.hpp>
00018 #include <functional>
00019 
00020 // user include files
00021 #include "FWCore/Framework/interface/ScheduleInfo.h"
00022 #include "FWCore/Framework/interface/Schedule.h"
00023 
00024 #include "FWCore/ParameterSet/interface/Registry.h"
00025 
00026 using namespace edm;
00027 //
00028 // constants, enums and typedefs
00029 //
00030 
00031 //
00032 // static data member definitions
00033 //
00034 
00035 //
00036 // constructors and destructor
00037 //
00038 ScheduleInfo::ScheduleInfo(const Schedule* iSchedule):
00039 schedule_(iSchedule)
00040 {
00041 }
00042 
00043 // ScheduleInfo::ScheduleInfo(const ScheduleInfo& rhs)
00044 // {
00045 //    // do actual copying here;
00046 // }
00047 
00048 ScheduleInfo::~ScheduleInfo()
00049 {
00050 }
00051 
00052 //
00053 // assignment operators
00054 //
00055 // const ScheduleInfo& ScheduleInfo::operator=(const ScheduleInfo& rhs)
00056 // {
00057 //   //An exception safe implementation is
00058 //   ScheduleInfo temp(rhs);
00059 //   swap(rhs);
00060 //
00061 //   return *this;
00062 // }
00063 
00064 //
00065 // member functions
00066 //
00067 
00068 //
00069 // const member functions
00070 //
00071 void 
00072 ScheduleInfo::availableModuleLabels(std::vector<std::string>& oLabelsToFill) const
00073 {
00074    std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
00075    
00076    oLabelsToFill.reserve(oLabelsToFill.size()+desc.size());
00077    std::transform(desc.begin(),desc.end(),
00078                   std::back_inserter(oLabelsToFill),
00079                   boost::bind(&ModuleDescription::moduleLabel,_1));
00080 }
00081 
00082 const ParameterSet*
00083 ScheduleInfo::parametersForModule(const std::string& iLabel) const 
00084 {
00085    std::vector<ModuleDescription const*> desc = schedule_->getAllModuleDescriptions();
00086    
00087    std::vector<ModuleDescription const*>::iterator itFound = std::find_if(desc.begin(),
00088                                                                           desc.end(),
00089                                                                           boost::bind(std::equal_to<std::string>(),
00090                                                                                       iLabel,
00091                                                                                       boost::bind(&ModuleDescription::moduleLabel,_1)));
00092    if (itFound == desc.end()) {
00093       return 0;
00094    }
00095    return pset::Registry::instance()->getMapped((*itFound)->parameterSetID());
00096 }
00097 
00098 void 
00099 ScheduleInfo::availablePaths(std::vector<std::string>& oLabelsToFill) const
00100 {
00101    schedule_->availablePaths(oLabelsToFill);
00102 }
00103 
00104 void 
00105 ScheduleInfo::modulesInPath(const std::string& iPathLabel,
00106                             std::vector<std::string>& oLabelsToFill) const
00107 {
00108    schedule_->modulesInPath(iPathLabel, oLabelsToFill);
00109 }
00110 
00111 //
00112 // static member functions
00113 //