LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 44 of file DetectorClocksStandardTestHelpers.h.

References fhicl::ParameterSet::get_if_present(), and MF_LOG_TRACE.

45  {
46  // some feedback about whether we are using the right configuration
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);
52 
53  if (ServiceProviderName == "DetectorClocksServiceStandard") {
54  MF_LOG_TRACE("setupProvider")
55  << "Verified service implementation for DetectorClocksService: '" << ServiceProviderPath
56  << "'";
57  }
58  else {
59  mf::LogWarning("setupProvider")
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.";
65  }
66  }
67 
68  //
69  // create the new DetectorClocksStandard service provider
70  //
71  auto detClocks = std::make_unique<detinfo::DetectorClocksStandard>(pset);
72 
73  //
74  // all done
75  //
76  return detClocks;
77  } // setup()
#define MF_LOG_TRACE(id)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning

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