File indexing completed on 2023-03-17 11:02:24
0001 #ifndef FWCore_Framework_UnscheduledConfigurator_h
0002 #define FWCore_Framework_UnscheduledConfigurator_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <unordered_map>
0023
0024
0025
0026
0027
0028 namespace edm {
0029 class Worker;
0030 class UnscheduledAuxiliary;
0031
0032 class UnscheduledConfigurator {
0033 public:
0034 template <typename IT>
0035 UnscheduledConfigurator(IT iBegin, IT iEnd, UnscheduledAuxiliary const* iAux) : m_aux(iAux) {
0036 for (auto it = iBegin; it != iEnd; ++it) {
0037 m_labelToWorker.emplace((*it)->description()->moduleLabel(), *it);
0038 }
0039 }
0040
0041 UnscheduledConfigurator(const UnscheduledConfigurator&) = delete;
0042 const UnscheduledConfigurator& operator=(const UnscheduledConfigurator&) = delete;
0043
0044
0045 Worker* findWorker(std::string const& iLabel) const {
0046 auto itFound = m_labelToWorker.find(iLabel);
0047 if (itFound != m_labelToWorker.end()) {
0048 return itFound->second;
0049 }
0050 return nullptr;
0051 }
0052
0053 UnscheduledAuxiliary const* auxiliary() const { return m_aux; }
0054
0055 private:
0056
0057 std::unordered_map<std::string, Worker*> m_labelToWorker;
0058 UnscheduledAuxiliary const* m_aux;
0059 };
0060 }
0061
0062 #endif