Set up a detinfo::DetectorClocksStandard from a parameter set.
More...
#include "DetectorClocksStandardTestHelpers.h"
template<>
struct testing::ProviderSetupClass< detinfo::DetectorClocksStandard >
Set up a detinfo::DetectorClocksStandard from a parameter set.
- Returns
- pointer to a newly created and set up DetectorClocksService
This function specialization enables the support of SetupProvider()
methods of testing::TesterEnvironment
.
Definition at line 42 of file DetectorClocksStandardTestHelpers.h.
Definition at line 44 of file DetectorClocksStandardTestHelpers.h.
References fhicl::ParameterSet::get_if_present(), and MF_LOG_TRACE.
47 std::string ServiceProviderPath;
48 if (pset.get_if_present(
"service_provider", ServiceProviderPath)) {
49 std::string ServiceProviderName = ServiceProviderPath;
50 size_t iSlash = ServiceProviderPath.rfind(
'/');
51 if (iSlash != std::string::npos) ServiceProviderName.erase(0, iSlash + 1);
53 if (ServiceProviderName ==
"DetectorClocksServiceStandard") {
55 <<
"Verified service implementation for DetectorClocksService: '" << ServiceProviderPath
60 <<
"This set up is for a DetectorClocksStandard provider.\n" 61 "Your configuration specifies a '" 62 << ServiceProviderPath
63 <<
"' service implementation" 64 " that is not known to use that provider.";
71 auto detClocks = std::make_unique<detinfo::DetectorClocksStandard>(pset);
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
The documentation for this struct was generated from the following file: