Static Public Member Functions | List of all members
testing::ProviderSetupClass< detinfo::DetectorClocksStandard > Struct Template Reference

Set up a detinfo::DetectorClocksStandard from a parameter set. More...

#include <DetectorClocksStandardTestHelpers.h>

Static Public Member Functions

static std::unique_ptr< detinfo::DetectorClocksStandardsetup (fhicl::ParameterSet const &pset)
 

Detailed Description

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.

Member Function Documentation

Definition at line 45 of file DetectorClocksStandardTestHelpers.h.

46  {
47  // some feedback about whether we are using the right configuration
48  std::string ServiceProviderPath;
49  if (pset.get_if_present("service_provider", ServiceProviderPath)) {
50  std::string ServiceProviderName = ServiceProviderPath;
51  size_t iSlash = ServiceProviderPath.rfind('/');
52  if (iSlash != std::string::npos) ServiceProviderName.erase(0, iSlash + 1);
53 
54  if (ServiceProviderName == "DetectorClocksServiceStandard") {
55  MF_LOG_TRACE("setupProvider")
56  << "Verified service implementation for DetectorClocksService: '" << ServiceProviderPath
57  << "'";
58  }
59  else {
60  mf::LogWarning("setupProvider")
61  << "This set up is for a DetectorClocksStandard provider.\n"
62  "Your configuration specifies a '"
63  << ServiceProviderPath
64  << "' service implementation"
65  " that is not known to use that provider.";
66  }
67  }
68 
69  //
70  // create the new DetectorClocksStandard service provider
71  //
72  auto detClocks = std::make_unique<detinfo::DetectorClocksStandard>(pset);
73 
74  //
75  // all done
76  //
77  return detClocks;
78  } // setup()
std::string string
Definition: nybbler.cc:12
#define MF_LOG_TRACE(id)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning

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