/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
CondCore/CondDB/interface/CoralServiceWrapper.h
29 строк
885 B
Cms Build
Clang-Format
29 май 2019, 08:23
29 май 2019, 08:23
087900c
Код
Авторство
О чём код?
#ifndef CondCore_CondDB_CondServiceWrapper_h #define CondCore_CondDB_CondServiceWrapper_h #include <string> namespace coral { class Service; } /** * The wrapper is used to allow edm::PluginFactory to change its * return type to unique_ptr from a raw pointer. The unique_ptr does * not work for coral::Service, because its destructor is protected * and ownership is managed by intrusive reference counting. */ namespace cond { struct CoralServiceWrapperBase { virtual ~CoralServiceWrapperBase() = default; virtual coral::Service* create(const std::string& componentname) const = 0; }; template <typename T> struct CoralServiceWrapper : public CoralServiceWrapperBase { ~CoralServiceWrapper() override = default; coral::Service* create(const std::string& componentname) const override { return new T{componentname}; } }; } // namespace cond #endif