1 #ifndef FWCore_PluginManager_PluginFactory_h 2 #define FWCore_PluginManager_PluginFactory_h 35 template<
typename R,
typename... Args>
38 friend class DummyFriend;
44 virtual R*
create(Args...)
const = 0;
48 struct PMaker :
public PMakerBase {
53 return new TPlug(std::forward<Args>(
args)...);
82 finishedConstruction();
90 #define CONCATENATE_HIDDEN(a,b) a ## b 91 #define CONCATENATE(a,b) CONCATENATE_HIDDEN(a,b) 92 #define EDM_REGISTER_PLUGINFACTORY(_factory_,_category_) \ 93 namespace edmplugin {\ 94 template<> edmplugin::PluginFactory<_factory_::TemplateArgType>* edmplugin::PluginFactory<_factory_::TemplateArgType>::get() { CMS_THREAD_SAFE static edmplugin::PluginFactory<_factory_::TemplateArgType> s_instance; return &s_instance;}\ 95 template<> const std::string& edmplugin::PluginFactory<_factory_::TemplateArgType>::category() const { static const std::string s_cat(_category_); return s_cat;}\ 96 } enum {CONCATENATE(dummy_edm_register_pluginfactory_, __LINE__)} 98 #define EDM_REGISTER_PLUGINFACTORY2(_factory_,_category_) \ 99 namespace edmplugin {\ 100 template<> edmplugin::PluginFactory<_factory_::TemplateArgType>* edmplugin::PluginFactory<_factory_::TemplateArgType>::get() { CMS_THREAD_SAFE static edmplugin::PluginFactory<_factory_::TemplateArgType> s_instance; return &s_instance;}\ 101 template<> const std::string& edmplugin::PluginFactory<_factory_::TemplateArgType>::category() const { static const std::string s_cat(_category_); return s_cat;}\ 102 } enum {CONCATENATE(dummy_edm_register_pluginfactory_2_, __LINE__)} 106 #define EDM_PLUGIN_SYM(x,y) EDM_PLUGIN_SYM2(x,y) 107 #define EDM_PLUGIN_SYM2(x,y) x ## y 109 #define DEFINE_EDM_PLUGIN(factory,type,name) \ 110 static const factory::PMaker<type> EDM_PLUGIN_SYM(s_maker , __LINE__ ) (name) 112 #define DEFINE_EDM_PLUGIN2(factory,type,name) \ 113 static const factory::PMaker<type> EDM_PLUGIN_SYM(s_maker2 , __LINE__ ) (name)
def create(alignables, pedeDump, additionalData, outputFile, config)
void registerPMaker(void *iPMaker, const std::string &iName)
R * create(const std::string &iName, Args...args) const
R * create(Args...args) const override
void registerPMaker(PMakerBase *iPMaker, const std::string &iName)
PMaker(const std::string &iName)
void * findPMaker(const std::string &iName) const
R * tryToCreate(const std::string &iName, Args...args) const
like above but returns 0 if iName is unknown
T get(const Candidate &c)
void * tryToFindPMaker(const std::string &iName) const
R *(Args...) TemplateArgType