/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimG4Core/Watcher/interface/SimWatcherMaker.h
58 строк
2 KB
Cms Build
Clang-Format
08 май 2019, 15:12
08 май 2019, 15:12
22aeb75
Код
Авторство
О чём код?
#ifndef Watcher_SimWatcherMaker_h #define Watcher_SimWatcherMaker_h // -*- C++ -*- // // Package: Watcher // Class : SimWatcherMaker // /**\class SimWatcherMaker SimWatcherMaker.h SimG4Core/Watcher/interface/SimWatcherMaker.h Description: Makes a particular type of SimWatcher Usage: <usage> */ // // Original Author: // Created: Tue Nov 22 13:03:44 EST 2005 // // system include files #include <memory> // user include files #include "SimG4Core/Notification/interface/SimActivityRegistryEnroller.h" #include "SimG4Core/Watcher/interface/SimWatcherMakerBase.h" // forward declarations template <class T> class SimWatcherMaker : public SimWatcherMakerBase { public: SimWatcherMaker() {} // ---------- const member functions --------------------- void make(const edm::ParameterSet &p, SimActivityRegistry ®, std::shared_ptr<SimWatcher> &oWatcher, std::shared_ptr<SimProducer> &oProd) const override { auto returnValue = std::make_shared<T>(p); SimActivityRegistryEnroller::enroll(reg, returnValue.get()); oWatcher = returnValue; // If this is also a SimProducer, set the value oProd = this->getSimProducer(returnValue.get(), returnValue); } private: std::shared_ptr<SimProducer> getSimProducer(SimProducer *, std::shared_ptr<T> &iProd) const { return std::shared_ptr<SimProducer>(iProd); } std::shared_ptr<SimProducer> getSimProducer(void *, std::shared_ptr<T> &iProd) const { return std::shared_ptr<SimProducer>(); } }; #endif