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 ()
 
- Public Member Functions inherited from edm::eventsetup::ComponentMakerBaseHelper
virtual ~ComponentMakerBaseHelper ()
 

Private Member Functions

 ComponentMaker (const ComponentMaker &)=delete
 
const ComponentMakeroperator= (const ComponentMaker &)=delete
 
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

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

Definition at line 61 of file ComponentMaker.h.

Constructor & Destructor Documentation

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

Definition at line 59 of file ComponentMaker.h.

59 {}
template<class T, class TComponent>
edm::eventsetup::ComponentMaker< T, TComponent >::ComponentMaker ( const ComponentMaker< T, TComponent > &  )
privatedelete

Member Function Documentation

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 95 of file ComponentMaker.h.

References edm::eventsetup::ComponentMakerBaseHelper::createComponentDescription(), and heppy_report::description.

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

Definition at line 77 of file ComponentMaker.h.

77  {
78  iProv->setDescription(iDesc);
79  }
template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescription ( void *  ,
const ComponentDescription  
) const
inlineprivate

Definition at line 88 of file ComponentMaker.h.

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

Definition at line 80 of file ComponentMaker.h.

80  {
81  iFinder->setDescriptionForFinder(iDesc);
82  }
template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setDescriptionForFinder ( void *  ,
const ComponentDescription  
) const
inlineprivate

Definition at line 89 of file ComponentMaker.h.

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

Definition at line 83 of file ComponentMaker.h.

83  {
84  //The 'appendToDataLabel' parameter was added very late in the development cycle and since
85  // the ParameterSet is not sent to the base class we must set the value after construction
86  iProv->setAppendToDataLabel(iPSet);
87  }
template<class T, class TComponent>
void edm::eventsetup::ComponentMaker< T, TComponent >::setPostConstruction ( void *  ,
const edm::ParameterSet  
) const
inlineprivate

Definition at line 90 of file ComponentMaker.h.

90 {}