19 #ifndef LARCORE_COREUTILS_SERVICEUTIL_H 20 #define LARCORE_COREUTILS_SERVICEUTIL_H 29 #include "cetlib_except/demangle.h" 32 #include <type_traits> 39 template <
typename PROVIDER>
42 template <
typename... Services>
83 typename T::provider_type
const* pProvider = h->provider();
86 <<
"Service <" << cet::demangle_symbol(
typeid(T).name())
87 <<
"> offered a null provider";
122 template <
typename... Services>
137 template <
typename... Services>
146 template <
typename PROVIDER>
154 "Service provider classes must not be copiable" 158 "Service provider classes must not be copiable" 162 "Service provider classes must not be movable" 166 "Service provider classes must not be movable" 172 template <
typename SERVICE>
187 "provider() method has unsupported signature" 194 template <
typename First,
typename... Others>
197 typename First::provider_type,
typename Others::provider_type...
203 lar::providerFrom<First>()
209 template <
typename Service>
220 #endif //#LARCORE_COREUTILS_SERVICEUTIL_H
typename SERVICE::provider_type provider_type
T::provider_type const * providerFrom()
Returns a constant pointer to the provider of specified service.
Defines a class that can't be copied nor moved.
ServiceProviderRequirementsChecker< provider_type > provider_checker
Checker for the provider.
ProviderPack< Providers... > makeProviderPack(Providers const *...providers)
Function to create a ProviderPack from the function arguments.
Compiles only if PROVIDER class satisfied service provider requirements.
provider_type const *(SERVICE::*)() const provider_func_type
auto providersFrom()
Returns a lar::ProviderPack with providers from all services.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string value(boost::any const &)
LArSoft-specific namespace.
Container for a list of pointers to providers.
Data structure containing constant pointers to classes.
provider_type provider_type