test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual boost::shared_ptr
< base_type
addTo (EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet const &iConfiguration, bool replaceExisting) const
 
 ComponentMaker ()
 
- Public Member Functions inherited from edm::eventsetup::ComponentMakerBaseHelper
virtual ~ComponentMakerBaseHelper ()
 

Private Member Functions

 ComponentMaker (const ComponentMaker &)
 
const ComponentMakeroperator= (const ComponentMaker &)
 
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 63 of file ComponentMaker.h.

Constructor & Destructor Documentation

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

Definition at line 61 of file ComponentMaker.h.

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

Member Function Documentation

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

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

Definition at line 102 of file ComponentMaker.h.

References idDealer::description.

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

Definition at line 79 of file ComponentMaker.h.

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

Definition at line 90 of file ComponentMaker.h.

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

Definition at line 82 of file ComponentMaker.h.

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

Definition at line 92 of file ComponentMaker.h.

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

Definition at line 85 of file ComponentMaker.h.

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

Definition at line 94 of file ComponentMaker.h.

94  {
95  }