LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 80 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 47 of file ProviderTestHelpers.h.

Referenced by testing::setupProvider().

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

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