LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
Service returning a provider. More...
#include "ServiceProviderWrappers.h"
Public Types | |
using | provider_type = PROVIDER |
type of the service provider More... | |
using | Parameters = art::ServiceTable< typename provider_type::Config > |
Type of configuration parameter (for art description) More... | |
Public Member Functions | |
SimpleServiceProviderWrapper (Parameters const &config, art::ActivityRegistry &) | |
Constructor (using a configuration table) More... | |
provider_type const * | provider () const |
Returns a constant pointer to the service provider. More... | |
Private Attributes | |
std::unique_ptr< provider_type > | prov |
service provider More... | |
Service returning a provider.
PROVIDER | type of service provider to be returned |
This class provides the simplest possible art service to wrap a LArSoft service provider. The service is not reacting to any framework events.
The configuration is passed directly to the provider.
The simplest way to create an art service with this template is:
#include "larcore/CoreUtils/ServiceProviderWrappers.h" #include "path/to/MyProvider.h" #include "art/Framework/Services/Registry/ServiceMacros.h" namespace myprov { using MyService = lar::SimpleServiceProviderWrapper<MyProvider>; } DECLARE_ART_SERVICE(myprov::MyService, LEGACY)
An implementation file is necessary too, that will look like:
#include "path/to/MyService.h" DEFINE_ART_SERVICE(myprov::MyService)
If callback registration is needed, a class can derive from this template and still gain a bit of boilerplate facility. That is:
provider_type
definition (required by lar::providerFrom()
)provider()
method to access the provider (required by lar::providerFrom()
)Parameters
definition (used by art to print accepted configuration)Requirements on the service provider:
Config
being the configuration object. This is the object wrapped by fhicl::Table
when performing FHiCL validation.Definition at line 90 of file ServiceProviderWrappers.h.
using lar::SimpleServiceProviderWrapper< PROVIDER >::Parameters = art::ServiceTable<typename provider_type::Config> |
Type of configuration parameter (for art description)
Definition at line 96 of file ServiceProviderWrappers.h.
using lar::SimpleServiceProviderWrapper< PROVIDER >::provider_type = PROVIDER |
type of the service provider
Definition at line 93 of file ServiceProviderWrappers.h.
|
inline |
Constructor (using a configuration table)
Definition at line 101 of file ServiceProviderWrappers.h.
|
inline |
Returns a constant pointer to the service provider.
Definition at line 107 of file ServiceProviderWrappers.h.
|
private |
service provider
Definition at line 112 of file ServiceProviderWrappers.h.