CMS 3D CMS Logo

PrincipalCache.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_PrincipalCache_h
2 #define FWCore_Framework_PrincipalCache_h
3 
4 /*
5 Contains smart pointers to the RunPrincipals,
6 LuminosityBlockPrincipals, EventPrincipals,
7 and ProcessBlockPrincipals. It keeps the
8 objects alive so they can be reused as
9 necessary.
10 
11 Original Author: W. David Dagenhart
12 */
13 
15 
16 #include <memory>
17 #include <vector>
18 
19 namespace edm {
20 
21  class ProcessBlockPrincipal;
22  class RunPrincipal;
23  class LuminosityBlockPrincipal;
24  class EventPrincipal;
25  class ProductRegistry;
26  class PreallocationConfiguration;
27 
29  public:
32  PrincipalCache(PrincipalCache&&) = default;
33 
36 
37  enum class ProcessBlockType { New, Input };
40  }
41 
42  std::shared_ptr<RunPrincipal> getAvailableRunPrincipalPtr();
43  std::shared_ptr<LuminosityBlockPrincipal> getAvailableLumiPrincipalPtr();
44 
45  EventPrincipal& eventPrincipal(unsigned int iStreamIndex) const { return *(eventPrincipals_[iStreamIndex]); }
46 
48  void insert(std::unique_ptr<ProcessBlockPrincipal>);
49  void insertForInput(std::unique_ptr<ProcessBlockPrincipal>);
50  void insert(std::unique_ptr<RunPrincipal>);
51  void insert(std::unique_ptr<LuminosityBlockPrincipal>);
52  void insert(std::shared_ptr<EventPrincipal>);
53 
54  void adjustEventsToNewProductRegistry(std::shared_ptr<ProductRegistry const>);
55 
57 
58  private:
59  std::unique_ptr<ProcessBlockPrincipal> processBlockPrincipal_;
60  std::unique_ptr<ProcessBlockPrincipal> inputProcessBlockPrincipal_;
63  std::vector<std::shared_ptr<EventPrincipal>> eventPrincipals_;
64  };
65 } // namespace edm
66 
67 #endif
std::unique_ptr< ProcessBlockPrincipal > processBlockPrincipal_
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
edm::ReusableObjectHolder< RunPrincipal > runHolder_
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
std::shared_ptr< RunPrincipal > getAvailableRunPrincipalPtr()
void adjustEventsToNewProductRegistry(std::shared_ptr< ProductRegistry const >)
void adjustIndexesAfterProductRegistryAddition()
std::unique_ptr< ProcessBlockPrincipal > inputProcessBlockPrincipal_
ProcessBlockPrincipal & processBlockPrincipal() const
ProcessBlockPrincipal & processBlockPrincipal(ProcessBlockType processBlockType) const
edm::ReusableObjectHolder< LuminosityBlockPrincipal > lumiHolder_
std::vector< std::shared_ptr< EventPrincipal > > eventPrincipals_
void insert(std::unique_ptr< ProcessBlockPrincipal >)
void insertForInput(std::unique_ptr< ProcessBlockPrincipal >)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
HLT enums.
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()