7 #ifndef ASG_TOOLS__ASG_COMPONENT_FACTORIES_H
8 #define ASG_TOOLS__ASG_COMPONENT_FACTORIES_H
18 #ifdef XAOD_STANDALONE
21 StatusCode registerComponentFactory (
const std::string&
type,
const std::function<std::unique_ptr<AsgComponent>(
const std::string&
name)>& factory);
24 const std::function<std::unique_ptr<AsgComponent>(
const std::string&
name)> *getComponentFactory (
const std::string&
type);
32 template<
typename T>
StatusCode registerToolFactory (
const std::string&
type)
34 return registerComponentFactory (
type, [] (
const std::string&
name) -> std::unique_ptr<AsgComponent> {
return std::make_unique<T> (
name); });
36 template<
typename T>
StatusCode registerServiceFactory (
const std::string&
type)
38 return registerComponentFactory (
type, [] (
const std::string&
name) -> std::unique_ptr<AsgComponent> {
return std::make_unique<T> (
name,
nullptr); });
40 template<
typename T>
StatusCode registerAlgorithmFactory (
const std::string&
type)
42 return registerComponentFactory (
type, [] (
const std::string&
name) -> std::unique_ptr<AsgComponent> {
return std::make_unique<T> (
name,
nullptr); });