/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/ServiceRegistry/interface/ServiceWrapper.h
57 строк
2 KB
Chris Jones
Fix code-checks errors in FWCore and DataFormats/Common
13 окт 2020, 23:36
13 окт 2020, 23:36
83336a0
Код
Авторство
О чём код?
#ifndef ServiceRegistry_ServiceWrapper_h #define ServiceRegistry_ServiceWrapper_h // -*- C++ -*- // // Package: ServiceRegistry // Class : ServiceWrapper // /**\class ServiceWrapper ServiceWrapper.h FWCore/ServiceRegistry/interface/ServiceWrapper.h Description: Wrapper around a Service Usage: Implementation detail of the ServiceRegistry system */ // // Original Author: Chris Jones // Created: Mon Sep 5 13:33:01 EDT 2005 // // system include files #include <memory> // user include files #include "FWCore/ServiceRegistry/interface/ServiceWrapperBase.h" #include "FWCore/Utilities/interface/propagate_const.h" // forward declarations namespace edm { class ParameterSet; class ActivityRegistry; namespace serviceregistry { template <class T> class ServiceWrapper : public ServiceWrapperBase { public: ServiceWrapper(std::unique_ptr<T> iService) : service_(std::move(iService)) {} ServiceWrapper(const ServiceWrapper&) = delete; // stop default const ServiceWrapper& operator=(const ServiceWrapper&) = delete; // stop default // ---------- const member functions --------------------- T const& get() const { return *service_; } // ---------- static member functions -------------------- // ---------- member functions --------------------------- T& get() { return *service_; } private: // ---------- member data -------------------------------- edm::propagate_const<std::unique_ptr<T>> service_; }; } // namespace serviceregistry } // namespace edm #endif