CMS 3D CMS Logo

List of all members | Public Types | Static Public Member Functions
edm::eventsetup::SourceMakerTraits Struct Reference

#include <SourceFactory.h>

Public Types

typedef EventSetupRecordIntervalFinder base_type
 

Static Public Member Functions

template<class T >
static void addTo (EventSetupProvider &iProvider, std::shared_ptr< T > iComponent, ParameterSet const &iConfiguration, bool matchesPreceding)
 
static std::string const & baseType ()
 
static std::shared_ptr< base_typegetComponentAndRegisterProcess (EventSetupsController &esController, ParameterSet const &iConfiguration)
 
static void logInfoWhenSharing (ParameterSet const &iConfiguration)
 
static std::string name ()
 
static void putComponent (EventSetupsController &esController, ParameterSet const &iConfiguration, std::shared_ptr< base_type > const &component)
 
static void replaceExisting (EventSetupProvider &iProvider, std::shared_ptr< EventSetupRecordIntervalFinder > iComponent)
 

Detailed Description

Definition at line 53 of file SourceFactory.h.

Member Typedef Documentation

◆ base_type

Definition at line 54 of file SourceFactory.h.

Member Function Documentation

◆ addTo()

template<class T >
static void edm::eventsetup::SourceMakerTraits::addTo ( EventSetupProvider iProvider,
std::shared_ptr< T iComponent,
ParameterSet const &  iConfiguration,
bool  matchesPreceding 
)
inlinestatic

Definition at line 58 of file SourceFactory.h.

References edm::eventsetup::EventSetupProvider::add(), edm::eventsetup::addProviderTo(), and logInfoWhenSharing().

61  {
62  if (matchesPreceding) {
63  logInfoWhenSharing(iConfiguration);
64  }
65  //a source does not always have to be a provider
66  addProviderTo(iProvider, iComponent, static_cast<const T*>(nullptr));
67  std::shared_ptr<EventSetupRecordIntervalFinder> pFinder(iComponent);
68  iProvider.add(pFinder);
69  }
void addProviderTo(EventSetupProvider &iProvider, std::shared_ptr< T > iComponent, const ESProductResolverProvider *)
Definition: SourceFactory.h:41
static void logInfoWhenSharing(ParameterSet const &iConfiguration)

◆ baseType()

std::string const & edm::eventsetup::SourceMakerTraits::baseType ( )
static

◆ getComponentAndRegisterProcess()

std::shared_ptr< SourceMakerTraits::base_type > edm::eventsetup::SourceMakerTraits::getComponentAndRegisterProcess ( EventSetupsController esController,
ParameterSet const &  iConfiguration 
)
static

Definition at line 38 of file SourceFactory.cc.

References edm::eventsetup::EventSetupsController::getESSourceAndRegisterProcess(), and edm::eventsetup::EventSetupsController::indexOfNextProcess().

39  {
40  return esController.getESSourceAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
41  }

◆ logInfoWhenSharing()

void edm::eventsetup::SourceMakerTraits::logInfoWhenSharing ( ParameterSet const &  iConfiguration)
static

Definition at line 49 of file SourceFactory.cc.

References edm::ParameterSet::getParameter(), label, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addTo().

49  {
50  std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
51  std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
52  std::string label = iConfiguration.getParameter<std::string>("@module_label");
53  edm::LogVerbatim("EventSetupSharing")
54  << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
55  }
Log< level::Info, true > LogVerbatim
char const * label

◆ name()

std::string edm::eventsetup::SourceMakerTraits::name ( void  )
static

Definition at line 29 of file SourceFactory.cc.

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

29 { return "CMS EDM Framework ESSource"; }

◆ putComponent()

void edm::eventsetup::SourceMakerTraits::putComponent ( EventSetupsController esController,
ParameterSet const &  iConfiguration,
std::shared_ptr< base_type > const &  component 
)
static

Definition at line 43 of file SourceFactory.cc.

References edm::eventsetup::EventSetupsController::indexOfNextProcess(), and edm::eventsetup::EventSetupsController::putESSource().

45  {
46  esController.putESSource(iConfiguration, component, esController.indexOfNextProcess());
47  }

◆ replaceExisting()

void edm::eventsetup::SourceMakerTraits::replaceExisting ( EventSetupProvider iProvider,
std::shared_ptr< EventSetupRecordIntervalFinder iComponent 
)
static

Definition at line 32 of file SourceFactory.cc.

References Exception, and edm::errors::LogicError.

32  {
33  throw edm::Exception(edm::errors::LogicError) << "SourceMakerTraits::replaceExisting\n"
34  << "This function is not implemented and should never be called.\n"
35  << "Please report this to a Framework Developer\n";
36  }