1 #ifndef _GAUDI_PLUGIN_SERVICE_V1_H_ 2 #define _GAUDI_PLUGIN_SERVICE_V1_H_ 22 #define _PS_V1_DECLARE_FACTORY_WITH_ID( type, id, factory ) \ 23 _PS_V1_INTERNAL_DECLARE_FACTORY( type, id, factory, __LINE__ ) 25 #define _PS_V1_DECLARE_FACTORY( type, factory ) \ 26 _PS_V1_DECLARE_FACTORY_WITH_ID( type, ::Gaudi::PluginService::v1::Details::demangle<type>(), factory ) 28 #define _PS_V1_DECLARE_FACTORY_WITH_CREATOR_AND_ID( type, typecreator, id, factory ) \ 29 _PS_V1_INTERNAL_DECLARE_FACTORY_WITH_CREATOR( type, typecreator, id, factory, __LINE__ ) 31 #define _PS_V1_DECLARE_FACTORY_WITH_CREATOR( type, typecreator, factory ) \ 32 _PS_V1_DECLARE_FACTORY_WITH_CREATOR_AND_ID( type, typecreator, \ 33 ::Gaudi::PluginService::v1::Details::demangle<type>(), factory ) 35 #define _PS_V1_DECLARE_COMPONENT( type ) _PS_V1_DECLARE_FACTORY( type, type::Factory ) 37 #define _PS_V1_DECLARE_COMPONENT_WITH_ID( type, id ) _PS_V1_DECLARE_FACTORY_WITH_ID( type, id, type::Factory ) 39 #if !GAUDI_PLUGIN_SERVICE_USE_V2 40 #define DECLARE_FACTORY_WITH_ID( type, id, factory ) _PS_V1_DECLARE_FACTORY_WITH_ID( type, id, factory ) 41 #define DECLARE_FACTORY( type, factory ) _PS_V1_DECLARE_FACTORY( type, factory ) 42 #define DECLARE_FACTORY_WITH_CREATOR_AND_ID( type, typecreator, id, factory ) \ 43 _PS_V1_DECLARE_FACTORY_WITH_CREATOR_AND_ID( type, typecreator, id, factory ) 44 #define DECLARE_FACTORY_WITH_CREATOR( type, typecreator, factory ) \ 45 _PS_V1_DECLARE_FACTORY_WITH_CREATOR( type, typecreator, factory ) 46 #define DECLARE_COMPONENT( type ) _PS_V1_DECLARE_COMPONENT( type ) 47 #define DECLARE_COMPONENT_WITH_ID( type, id ) _PS_V1_DECLARE_COMPONENT_WITH_ID( type, id ) 52 namespace PluginService
57 template <
typename R,
typename... Args>
66 const FuncType c = Details::getCreator<FuncType>( id );
67 return c ? ( *c )( std::forward<Args>(
args )... ) : 0;
84 const char* what()
const throw()
override;
93 #endif //_GAUDI_PLUGIN_SERVICE_H_ static ReturnType create(const T &id, Args...args)
#define GAUDI_PLUGIN_SERVICE_V1_INLINE
Class wrapping the signature for a factory with any number of arguments.
R(* FuncType)(Args &&...)
static ReturnType create(const std::string &id, Args...args)
Helper functions to set/get the application return code.