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::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

Definition at line 54 of file SourceFactory.h.

Member Function Documentation

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 57 of file SourceFactory.h.

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

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

Definition at line 36 of file SourceFactory.cc.

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

Referenced by addTo().

37  {
38  return esController.getESSourceAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
39  }
void edm::eventsetup::SourceMakerTraits::logInfoWhenSharing ( ParameterSet const &  iConfiguration)
static

Definition at line 47 of file SourceFactory.cc.

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

Referenced by addTo().

47  {
48  std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
49  std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
50  std::string label = iConfiguration.getParameter<std::string>("@module_label");
51  edm::LogVerbatim("EventSetupSharing")
52  << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
53  }
char const * label
std::string edm::eventsetup::SourceMakerTraits::name ( void  )
static
void edm::eventsetup::SourceMakerTraits::putComponent ( EventSetupsController esController,
ParameterSet const &  iConfiguration,
std::shared_ptr< base_type > const &  component 
)
static

Definition at line 41 of file SourceFactory.cc.

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

Referenced by addTo().

43  {
44  esController.putESSource(iConfiguration, component, esController.indexOfNextProcess());
45  }
void edm::eventsetup::SourceMakerTraits::replaceExisting ( EventSetupProvider iProvider,
std::shared_ptr< EventSetupRecordIntervalFinder iComponent 
)
static

Definition at line 30 of file SourceFactory.cc.

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

Referenced by addTo().

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