CMS 3D CMS Logo

DelayedReader.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_DelayedReader_h
2 #define FWCore_Framework_DelayedReader_h
3 
4 /*----------------------------------------------------------------------
5 
6 DelayedReader: The abstract interface through which the Principal
7 uses input sources to retrieve EDProducts from external storage.
8 
9 ----------------------------------------------------------------------*/
10 
12 
13 #include <memory>
14 #include <mutex>
15 
16 namespace edm {
17 
18  class BranchKey;
19  class EDProductGetter;
20  class ModuleCallingContext;
22  class StreamContext;
23 
24  namespace signalslot {
25  template <typename T> class Signal;
26  }
27 
28  class DelayedReader {
29  public:
30  virtual ~DelayedReader();
31  std::unique_ptr<WrapperBase> getProduct(BranchKey const& k,
32  EDProductGetter const* ep,
33  ModuleCallingContext const* mcc = nullptr);
34 
35  void mergeReaders(DelayedReader* other) {mergeReaders_(other);}
36  void reset() {reset_();}
37 
38  std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> sharedResources() const {
39  return sharedResources_();
40  }
41 
42 
43  virtual signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> const* preEventReadFromSourceSignal() const = 0;
44  virtual signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> const* postEventReadFromSourceSignal() const = 0;
45 
46 
47  private:
48  virtual std::unique_ptr<WrapperBase> getProduct_(BranchKey const& k, EDProductGetter const* ep) = 0;
49  virtual void mergeReaders_(DelayedReader*) = 0;
50  virtual void reset_() = 0;
51  virtual std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> sharedResources_() const;
52 
53  };
54 }
55 
56 #endif
T const * getProduct_(RefCore const &ref, const EDProductGetter *prodGetter)
Definition: RefCoreGet.h:23
void mergeReaders(DelayedReader *other)
Definition: DelayedReader.h:35
T const * getProduct(RefCore const &ref)
Definition: RefCoreGet.h:41
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > sharedResources() const
Definition: DelayedReader.h:38
int k[5][pyjets_maxn]
HLT enums.