| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Static Public Member Functions | List of all members
Gaudi::PluginService::v2::Factory< R(Args...)> Struct Template Reference

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

`#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 36 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 39 of file PluginServiceV2.h.

## ◆ ReturnType

template<typename R , typename... Args>

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

Definition at line 38 of file PluginServiceV2.h.

## ◆ ReturnValueType

template<typename R , typename... Args>

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

Definition at line 40 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 37 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
| ) |  |
| inline static

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

Definition at line 44 of file PluginServiceV2.h.

44 {
45 try {
46 return Details::Registry::instance().get<FactoryType>( Details::stringify_id( id ) )(
47 std::forward<Args>( args )... );
48 } catch ( std::bad_any_cast& ) {
49 Details::reportBadAnyCast( typeid( FactoryType ), Details::stringify_id( id ) );
50 return nullptr;
51 }
52 }
Gaudi::PluginService::v2::Details::reportBadAnyCast
void reportBadAnyCast(const std::type_info &factory_type, const std::string &id)
Definition: PluginServiceV2.cpp:120
Gaudi::PluginService::v2::Factory< R(Args...)>::FactoryType
typename Traits::FactoryType FactoryType
Definition: PluginServiceV2.h:39
gaudirun.args
args
Definition: gaudirun.py:307

The documentation for this struct was generated from the following file:

- GaudiPluginService/Gaudi/PluginServiceV2.h