20 #ifndef LARCORE_COREUTILS_SERVICEPROVIDERWRAPPERS_H
21 #define LARCORE_COREUTILS_SERVICEPROVIDERWRAPPERS_H 1
28 #include "art/Framework/Services/Registry/ServiceTable.h"
35 namespace art {
class ActivityRegistry; }
36 namespace fhicl {
class ParameterSet; }
87 template <
class PROVIDER>
94 using Parameters = art::ServiceTable<typename provider_type::Config>;
100 :
prov(std::make_unique<provider_type>(config()))
110 std::unique_ptr<provider_type>
prov;
131 template <
class PROVIDER>
234 template <
typename PROVIDER,
typename INTERFACE>
249 = art::ServiceTable<typename concrete_provider_type::Config>;
255 :
prov(std::make_unique<concrete_provider_type>(config()))
260 std::unique_ptr<concrete_provider_type>
prov;
264 {
return prov.get(); }
272 #endif // LARCORE_COREUTILS_SERVICEPROVIDERWRAPPERS_H
art::ServiceTable< typename concrete_provider_type::Config > Parameters
Type of configuration parameter (for art description)
virtual provider_type const * do_provider() const override
Returns a constant pointer to the service provider.
Utilities related to art service access.
PROVIDER concrete_provider_type
type of service provider implementation
art::ServiceTable< typename provider_type::Config > Parameters
Type of configuration parameter (for art description)
typename service_interface_type::provider_type provider_type
type of service provider interface
INTERFACE service_interface_type
art service interface class
SimpleServiceProviderWrapper(Parameters const &config, art::ActivityRegistry &)
Constructor (using a configuration table)
virtual provider_type const * do_provider() const =0
Implementation of the provider() function, to be overridden.
PROVIDER provider_type
type of the service provider
virtual ~ServiceProviderInterfaceWrapper()=default
Virtual destructor.
provider_type const * provider() const
Returns a constant pointer to the service provider interface.
provider_type const * provider() const
Returns a constant pointer to the service provider.
std::unique_ptr< concrete_provider_type > prov
service provider
std::unique_ptr< provider_type > prov
service provider
Service implementation returning a provider.
Service returning a provider interface.
Service returning a provider.
PROVIDER provider_type
type of the service provider
ServiceProviderImplementationWrapper(Parameters const &config, art::ActivityRegistry &)
Constructor (using a configuration table)