List of all members
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 > testing::DefaultSetupProviderClass< Prov >

Additional Inherited Members

- Static Public Member Functions inherited from testing::DefaultSetupProviderClass< Prov >
template<typename... Args>
static std::unique_ptr< Prov > setup (Args &&...args)
 Instantiates a new provider with specified arguments for constructor. More...
 
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 79 of file ProviderTestHelpers.h.


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