CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions
edm::eventsetup::ComponentMaker< T, TComponent > Class Template Reference

#include <ComponentMaker.h>

Inheritance diagram for edm::eventsetup::ComponentMaker< T, TComponent >:
edm::eventsetup::ComponentMakerBase< T > edm::eventsetup::ComponentMakerBaseHelper

Public Types

typedef T::base_type base_type
 
- Public Types inherited from edm::eventsetup::ComponentMakerBase< T >
typedef T::base_type base_type
 

Public Member Functions

std::shared_ptr< base_typeaddTo (EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet const &iConfiguration, bool replaceExisting) const override
 
 ComponentMaker ()
 
 ComponentMaker (const ComponentMaker &)=delete
 
const ComponentMakeroperator= (const ComponentMaker &)=delete
 
- Public Member Functions inherited from edm::eventsetup::ComponentMakerBaseHelper
virtual ~ComponentMakerBaseHelper ()
 

Private Member Functions

void setDescription (DataProxyProvider *iProv, const ComponentDescription &iDesc) const
 
void setDescription (void *, const ComponentDescription &) const
 
void setDescriptionForFinder (EventSetupRecordIntervalFinder *iFinder, const ComponentDescription &iDesc) const
 
void setDescriptionForFinder (void *, const ComponentDescription &) const
 
void setPostConstruction (DataProxyProvider *iProv, const edm::ParameterSet &iPSet) const
 
void setPostConstruction (void *, const edm::ParameterSet &) const
 

Additional Inherited Members

- Protected Member Functions inherited from edm::eventsetup::ComponentMakerBaseHelper
ComponentDescription createComponentDescription (ParameterSet const &iConfiguration) const
 

Detailed Description

template<class T, class TComponent>
class edm::eventsetup::ComponentMaker< T, TComponent >

Definition at line 57 of file ComponentMaker.h.

Member Typedef Documentation

◆ base_type

template<class T, class TComponent>
typedef T::base_type edm::eventsetup::ComponentMaker< T, TComponent >::base_type

Definition at line 62 of file ComponentMaker.h.

Constructor & Destructor Documentation

◆ ComponentMaker() [1/2]

template<class T, class TComponent>
edm::eventsetup::ComponentMaker< T, TComponent >::ComponentMaker ( )
inline

Definition at line 59 of file ComponentMaker.h.

59 {}

◆ ComponentMaker() [2/2]

template<class T, class TComponent>
edm::eventsetup::ComponentMaker< T, TComponent >::ComponentMaker ( const ComponentMaker< T, TComponent > &  )
delete

Member Function Documentation

◆ addTo()

template<class T , class TComponent >
std::shared_ptr< typename ComponentMaker< T, TComponent >::base_type > ComponentMaker::addTo ( EventSetupsController esController,
EventSetupProvider iProvider,
ParameterSet const &  iConfiguration,
bool  replaceExisting 
) const
overridevirtual

Implements edm::eventsetup::ComponentMakerBase< T >.

Definition at line 92 of file ComponentMaker.h.

96  {
97  // This adds components to the EventSetupProvider for the process. It might
98  // make a new component then add it or reuse a component from an earlier
99  // SubProcess or the top level process and add that.
100 
101  if (!replaceExisting) {
102  std::shared_ptr<typename T::base_type> alreadyMadeComponent =
103  T::getComponentAndRegisterProcess(esController, iConfiguration);
104 
105  if (alreadyMadeComponent) {
106  // This is for the case when a component is shared between
107  // a SubProcess and a previous SubProcess or the top level process
108  // because the component has an identical configuration to a component
109  // from the top level process or earlier SubProcess.
110  std::shared_ptr<TComponent> component(
111  std::static_pointer_cast<TComponent, typename T::base_type>(alreadyMadeComponent));
112  T::addTo(iProvider, component, iConfiguration, true);
113  return component;
114  }
115  }
116 
117  std::shared_ptr<TComponent> component = std::make_shared<TComponent>(iConfiguration);
118  ComponentDescription description = this->createComponentDescription(iConfiguration);
119 
120  this->setDescription(component.get(), description);
121  this->setDescriptionForFinder(component.get(), description);
122  this->setPostConstruction(component.get(), iConfiguration);
123 
124  if (replaceExisting) {
125  // This case is for ESProducers where in the first pass
126  // the algorithm thought the component could be shared
127  // across SubProcess's because there was an ESProducer
128  // from a previous process with an identical configuration.
129  // But in a later check it was determined that sharing was not
130  // possible because other components associated with the
131  // same record or records that record depends on had
132  // differing configurations.
133  T::replaceExisting(iProvider, component);
134  } else {
135  // This is for the case when a new component is being constructed.
136  // All components for the top level process fall in this category.
137  // Or it could be a SubProcess where neither the top level process
138  // nor any prior SubProcess had a component with exactly the same configuration.
139  T::addTo(iProvider, component, iConfiguration, false);
140  T::putComponent(esController, iConfiguration, component);
141  }
142  return component;
143  }

◆ operator=()

template<class T, class TComponent>
const ComponentMaker& edm::eventsetup::ComponentMaker< T, TComponent >::operator= ( const ComponentMaker< T, TComponent > &  )
delete

◆ setDescription() [1/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescription ( DataProxyProvider iProv,
const ComponentDescription iDesc 
) const
inlineprivate

Definition at line 74 of file ComponentMaker.h.

74  {
75  iProv->setDescription(iDesc);
76  }

◆ setDescription() [2/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescription ( void *  ,
const ComponentDescription  
) const
inlineprivate

Definition at line 85 of file ComponentMaker.h.

85 {}

◆ setDescriptionForFinder() [1/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescriptionForFinder ( EventSetupRecordIntervalFinder iFinder,
const ComponentDescription iDesc 
) const
inlineprivate

Definition at line 77 of file ComponentMaker.h.

77  {
78  iFinder->setDescriptionForFinder(iDesc);
79  }

◆ setDescriptionForFinder() [2/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescriptionForFinder ( void *  ,
const ComponentDescription  
) const
inlineprivate

Definition at line 86 of file ComponentMaker.h.

86 {}

◆ setPostConstruction() [1/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setPostConstruction ( DataProxyProvider iProv,
const edm::ParameterSet iPSet 
) const
inlineprivate

Definition at line 80 of file ComponentMaker.h.

80  {
81  //The 'appendToDataLabel' parameter was added very late in the development cycle and since
82  // the ParameterSet is not sent to the base class we must set the value after construction
83  iProv->setAppendToDataLabel(iPSet);
84  }

◆ setPostConstruction() [2/2]

template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setPostConstruction ( void *  ,
const edm::ParameterSet  
) const
inlineprivate

Definition at line 87 of file ComponentMaker.h.

87 {}
edm::eventsetup::ComponentMaker::setPostConstruction
void setPostConstruction(DataProxyProvider *iProv, const edm::ParameterSet &iPSet) const
Definition: ComponentMaker.h:80
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
edm::eventsetup::ComponentMaker::setDescription
void setDescription(DataProxyProvider *iProv, const ComponentDescription &iDesc) const
Definition: ComponentMaker.h:74
edm::eventsetup::ComponentMaker::setDescriptionForFinder
void setDescriptionForFinder(EventSetupRecordIntervalFinder *iFinder, const ComponentDescription &iDesc) const
Definition: ComponentMaker.h:77
edm::eventsetup::ComponentMakerBaseHelper::createComponentDescription
ComponentDescription createComponentDescription(ParameterSet const &iConfiguration) const
Definition: ComponentMaker.cc:9