1 #ifndef _GAUDI_PLUGIN_SERVICE_H_ 2 #define _GAUDI_PLUGIN_SERVICE_H_ 22 #define DECLARE_FACTORY_WITH_ID(type, id, factory) \ 23 _INTERNAL_DECLARE_FACTORY(type, id, factory, __LINE__) 25 #define DECLARE_FACTORY(type, factory) \ 26 DECLARE_FACTORY_WITH_ID(type, \ 27 ::Gaudi::PluginService::Details::demangle<type>(), factory) 29 #define DECLARE_FACTORY_WITH_CREATOR_AND_ID(type, typecreator, id, factory) \ 30 _INTERNAL_DECLARE_FACTORY_WITH_CREATOR(type, typecreator, id, factory, __LINE__) 32 #define DECLARE_FACTORY_WITH_CREATOR(type, typecreator, factory) \ 33 DECLARE_FACTORY_WITH_CREATOR_AND_ID(type, typecreator, \ 34 ::Gaudi::PluginService::Details::demangle<type>(), factory) 36 #define DECLARE_COMPONENT(type) \ 37 DECLARE_FACTORY(type, type::Factory) 39 #define DECLARE_COMPONENT_WITH_ID(type, id) \ 40 DECLARE_FACTORY_WITH_ID(type, id, type::Factory) 42 namespace Gaudi {
namespace PluginService {
44 #if !defined(__REFLEX__) || defined(ATLAS) 45 template <
typename R,
typename... Args>
53 const FuncType c = Details::getCreator<FuncType>(id);
54 return c ? (*c)(std::forward<Args>(
args)...) : 0;
69 const char* what()
const throw()
override;
75 #endif //_GAUDI_PLUGIN_SERVICE_H_ static ReturnType create(const T &id, Args...args)
R(* FuncType)(Args &&...)
static ReturnType create(const std::string &id, Args...args)
Class wrapping the signature for a factory with any number of arguments.
Helper functions to set/get the application return code.