The Gaudi Framework  master (594c33fa)
Gaudi::PluginService::v2::Factory< R(Args...)> Struct Template Reference

Class wrapping the signature for a factory with any number of arguments. More...

#include </builds/gaudi/Gaudi/GaudiPluginService/include/Gaudi/PluginServiceV2.h>

Public Types

using Traits = Details::Traits< R(Args...)>
 
using ReturnType = typename Traits::ReturnType
 
using FactoryType = typename Traits::FactoryType
 
using ReturnValueType = R
 

Static Public Member Functions

template<typename T >
static ReturnType create (const T &id, Args... args)
 Function to call to create an instance of type identified by id and that uses this factory signature. More...
 

Detailed Description

template<typename R, typename... Args>
struct Gaudi::PluginService::v2::Factory< R(Args...)>

Class wrapping the signature for a factory with any number of arguments.

Definition at line 87 of file PluginServiceV2.h.

Member Typedef Documentation

◆ FactoryType

template<typename R , typename... Args>
using Gaudi::PluginService::v2::Factory< R(Args...)>::FactoryType = typename Traits::FactoryType

Definition at line 90 of file PluginServiceV2.h.

◆ ReturnType

template<typename R , typename... Args>
using Gaudi::PluginService::v2::Factory< R(Args...)>::ReturnType = typename Traits::ReturnType

Definition at line 89 of file PluginServiceV2.h.

◆ ReturnValueType

template<typename R , typename... Args>
using Gaudi::PluginService::v2::Factory< R(Args...)>::ReturnValueType = R

Definition at line 91 of file PluginServiceV2.h.

◆ Traits

template<typename R , typename... Args>
using Gaudi::PluginService::v2::Factory< R(Args...)>::Traits = Details::Traits<R( Args... )>

Definition at line 88 of file PluginServiceV2.h.

Member Function Documentation

◆ create()

template<typename R , typename... Args>
template<typename T >
static ReturnType Gaudi::PluginService::v2::Factory< R(Args...)>::create ( const T &  id,
Args...  args 
)
inlinestatic

Function to call to create an instance of type identified by id and that uses this factory signature.

Definition at line 95 of file PluginServiceV2.h.

95  {
96  try {
97  return Details::Registry::instance().get<FactoryType>( Details::stringify_id( id ) )(
98  std::forward<Args>( args )... );
99  } catch ( std::bad_any_cast& ) {
100  Details::reportBadAnyCast( typeid( FactoryType ), Details::stringify_id( id ) );
101  return nullptr;
102  }
103  }

The documentation for this struct was generated from the following file:
Gaudi::PluginService::v2::Details::reportBadAnyCast
void reportBadAnyCast(const std::type_info &factory_type, const std::string &id)
Definition: PluginServiceV2.cpp:117
Gaudi::PluginService::v2::Factory< R(Args...)>::FactoryType
typename Traits::FactoryType FactoryType
Definition: PluginServiceV2.h:90
gaudirun.args
args
Definition: gaudirun.py:336