LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
testing::ProviderSetupClass< Prov > Struct Template Reference

Class to create and set up a new provider. More...

#include "ProviderTestHelpers.h"

Inheritance diagram for testing::ProviderSetupClass< Prov >:
testing::DefaultSetupProviderClass< Prov >

Static Public Member Functions

template<typename... Args>
static std::unique_ptr< Prov > setup (Args &&...args)
 Instantiates a new provider with specified arguments for constructor. More...
 

Detailed Description

template<typename Prov>
struct testing::ProviderSetupClass< Prov >

Class to create and set up a new provider.


Template Parameters
Provtype of provider being set up

The class ProviderSetupClass<Prov> is used by ProviderList to create and set up a new service provider. The class must have a static method setup(), compatible with setupProvider_t signature: it must return a fully set up provider contained in a std::unique_ptr<Prov>.

An example of implementation is DefaultSetupProviderClass, that is in fact the default implementation.

An example to implement a specific setup for a provider, MyProvider:

template <>
struct ProviderSetupClass<MyProvider> {

  static std::unique_ptr<MyProvider> setup
    (MyProvider::Config const& cfg)
    { return std::make_unique<MyProvider>(fhicl::Table<Config>(cfg)); }

}; // ProviderSetupClass<MyProvider>

calling a MyProvider(fhicl::Table<Config> const&) constructor.

Definition at line 76 of file ProviderTestHelpers.h.

Member Function Documentation

template<typename Prov >
template<typename... Args>
static std::unique_ptr<Prov> testing::DefaultSetupProviderClass< Prov >::setup ( Args &&...  args)
inlinestaticinherited

Instantiates a new provider with specified arguments for constructor.

Definition at line 42 of file ProviderTestHelpers.h.

Referenced by testing::setupProvider().

43  {
44  return std::make_unique<Prov>(std::forward<Args>(args)...);
45  }

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