1 #ifndef _GAUDI_PLUGIN_SERVICE_H_
2 #define _GAUDI_PLUGIN_SERVICE_H_
21 #define DECLARE_FACTORY_WITH_ID(type, id, factory) \
22 _INTERNAL_DECLARE_FACTORY(type, id, factory, __LINE__)
24 #define DECLARE_FACTORY(type, factory) \
25 DECLARE_FACTORY_WITH_ID(type, \
26 ::Gaudi::PluginService::Details::demangle<type>(), factory)
28 #define DECLARE_FACTORY_WITH_CREATOR_AND_ID(type, typecreator, id, factory) \
29 _INTERNAL_DECLARE_FACTORY_WITH_CREATOR(type, typecreator, id, factory, __LINE__)
31 #define DECLARE_FACTORY_WITH_CREATOR(type, typecreator, factory) \
32 DECLARE_FACTORY_WITH_CREATOR_AND_ID(type, typecreator, \
33 ::Gaudi::PluginService::Details::demangle<type>(), factory)
35 #define DECLARE_COMPONENT(type) \
36 DECLARE_FACTORY(type, type::Factory)
38 #define DECLARE_COMPONENT_WITH_ID(type, id) \
39 DECLARE_FACTORY_WITH_ID(type, id, type::Factory)
41 namespace Gaudi {
namespace PluginService {
51 const FuncType c = Details::getCreator<FuncType>(id);
52 return c ? (*c)() : 0;
57 std::ostringstream o; o << id;
63 template <
typename R,
typename A1>
72 const FuncType c = Details::getCreator<FuncType>(id);
73 return c ? (*c)(a1) : 0;
79 std::ostringstream o; o << id;
80 return create(o.str(), a1);
85 template <
typename R,
typename A1,
typename A2>
96 const FuncType c = Details::getCreator<FuncType>(id);
97 return c ? (*c)(a1, a2) : 0;
100 template <
typename T>
104 std::ostringstream o; o << id;
105 return create(o.str(), a1, a2);
110 template <
typename R,
typename A1,
typename A2,
typename A3>
123 const FuncType c = Details::getCreator<FuncType>(id);
124 return c ? (*c)(a1, a2, a3) : 0;
127 template <
typename T>
132 std::ostringstream o; o << id;
133 return create(o.str(), a1, a2, a3);
141 virtual const char* what()
const throw();
147 #endif //_GAUDI_PLUGIN_SERVICE_H_
R(* FuncType)(Arg1Type, Arg2Type, Arg3Type)
Class wrapping the signature for a factory without arguments.
static ReturnType create(const T &id, Arg1Type a1)
R(* FuncType)(Arg1Type, Arg2Type)
static ReturnType create(const std::string &id, Arg1Type a1)
Class wrapping the signature for a factory with 3 arguments.
static ReturnType create(const std::string &id, Arg1Type a1, Arg2Type a2)
static ReturnType create(const T &id, Arg1Type a1, Arg2Type a2, Arg3Type a3)
Class wrapping the signature for a factory with 2 arguments.
static ReturnType create(const T &id, Arg1Type a1, Arg2Type a2)
static ReturnType create(const std::string &id, Arg1Type a1, Arg2Type a2, Arg3Type a3)
static ReturnType create(const std::string &id)
This is a number of static methods for bootstrapping the Gaudi framework.
Class wrapping the signature for a factory with 1 argument.
static ReturnType create(const T &id)