CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventSetupsController.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Framework
4 // Class : EventSetupsController
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Wed Jan 12 14:30:44 CST 2011
11 // $Id: EventSetupsController.cc,v 1.3 2012/04/16 15:43:49 wdd Exp $
12 //
13 
14 // system include files
15 
16 // user include files
21 
22 #include <algorithm>
23 
24 //
25 // constants, enums and typedefs
26 //
27 
28 namespace edm {
29 
30  namespace eventsetup {
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39 {
40 }
41 
42 // EventSetupsController::EventSetupsController(const EventSetupsController& rhs)
43 // {
44 // // do actual copying here;
45 // }
46 
47 //EventSetupsController::~EventSetupsController()
48 //{
49 //}
50 
51 //
52 // assignment operators
53 //
54 // const EventSetupsController& EventSetupsController::operator=(const EventSetupsController& rhs)
55 // {
56 // //An exception safe implementation is
57 // EventSetupsController temp(rhs);
58 // swap(rhs);
59 //
60 // return *this;
61 // }
62 
63 //
64 // member functions
65 //
66 boost::shared_ptr<EventSetupProvider>
68 {
69  boost::shared_ptr<EventSetupProvider> returnValue(makeEventSetupProvider(iPSet) );
70 
71  fillEventSetupProvider(*this, *returnValue, iPSet);
72 
73  providers_.push_back(returnValue);
74 
75  return returnValue;
76 }
77 
78 void
80  std::for_each(providers_.begin(), providers_.end(), [&syncValue](boost::shared_ptr<EventSetupProvider> const& esp) {
81  esp->eventSetupForInstance(syncValue);
82  });
83 }
84 
85 void
87  std::for_each(providers_.begin(), providers_.end(), [](boost::shared_ptr<EventSetupProvider> const& esp) {
88  esp->forceCacheClear();
89  });
90 }
91 
92 boost::shared_ptr<EventSetupRecordIntervalFinder> const*
94  auto elements = essources_.equal_range(pset.id());
95  for (auto it = elements.first; it != elements.second; ++it) {
96  if (isTransientEqual(pset, *it->second.first)) {
97  return &it->second.second;
98  }
99  }
100  return 0;
101 }
102 
103 void
104 EventSetupsController::putESSource(ParameterSet const& pset, boost::shared_ptr<EventSetupRecordIntervalFinder> const& component) {
105  essources_.insert(std::pair<ParameterSetID, std::pair<ParameterSet const*, boost::shared_ptr<EventSetupRecordIntervalFinder> > >(pset.id(),
106  std::pair<ParameterSet const*, boost::shared_ptr<EventSetupRecordIntervalFinder> >(&pset, component)));
107 }
108 
109 void
111  essources_.clear();
112 }
113 
114 //
115 // const member functions
116 //
117 
118 //
119 // static member functions
120 //
121  }
122 }
ParameterSetID id() const
list elements
Definition: asciidump.py:414
void fillEventSetupProvider(EventSetupsController &esController, EventSetupProvider &cp, ParameterSet &params)
boost::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &)
void putESSource(ParameterSet const &pset, boost::shared_ptr< EventSetupRecordIntervalFinder > const &component)
std::vector< boost::shared_ptr< EventSetupProvider > > providers_
std::auto_ptr< EventSetupProvider > makeEventSetupProvider(ParameterSet const &params)
boost::shared_ptr< EventSetupRecordIntervalFinder > const * getAlreadyMadeESSource(ParameterSet const &pset) const
void eventSetupForInstance(IOVSyncValue const &syncValue) const
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
std::multimap< ParameterSetID, std::pair< ParameterSet const *, boost::shared_ptr< EventSetupRecordIntervalFinder > > > essources_