CMS 3D CMS Logo

ConstProductRegistry.h
Go to the documentation of this file.
1 #ifndef Framework_ConstProductRegistry_h
2 #define Framework_ConstProductRegistry_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : ConstProductRegistry
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu Sep 22 18:01:21 CEST 2005
19 //
20 
21 // system include files
22 #include <vector>
23 #include <string>
24 
25 // user include files
29 
30 // forward declarations
31 namespace edm {
33  public:
35 
37 
38  ConstProductRegistry(ConstProductRegistry const&) = delete; // Disallow copying and moving
39  ConstProductRegistry& operator=(ConstProductRegistry const&) = delete; // Disallow copying and moving
40 
41  // ---------- const member functions ---------------------
42  ProductRegistry const& productRegistry() const { return *reg_; }
43 
44  ProductList const& productList() const { return reg_->productList(); }
45 
46  // Return all the branch names currently known to *this. This
47  // does a return-by-value of the vector so that it may be used in
48  // a colon-initialization list.
49  std::vector<std::string> allBranchNames() const { return reg_->allBranchNames(); }
50 
51  // Return pointers to (const) BranchDescriptions for all the
52  // BranchDescriptions known to *this. This does a
53  // return-by-value of the vector so that it may be used in a
54  // colon-initialization list.
55  std::vector<BranchDescription const*> allBranchDescriptions() const { return reg_->allBranchDescriptions(); }
56 
57  bool anyProductProduced() const { return reg_->anyProductProduced(); }
58 
59  template <class T>
60  void watchProductAdditions(const T& iFunc) {
61  serviceregistry::connect_but_block_self(reg_->productAddedSignal_, iFunc);
62  }
63  template <class T, class TMethod>
64  void watchProductAdditions(T const& iObj, TMethod iMethod) {
65  using std::placeholders::_1;
66  serviceregistry::connect_but_block_self(reg_->productAddedSignal_, std::bind(iMethod, iObj, _1));
67  }
68 
69  private:
70  // ---------- member data --------------------------------
72  };
73 } // namespace edm
74 
75 #endif
edm::propagate_const< SignallingProductRegistry * > reg_
std::map< BranchKey, BranchDescription > ProductList
ProductRegistry const & productRegistry() const
void watchProductAdditions(T const &iObj, TMethod iMethod)
ProductRegistry::ProductList ProductList
void watchProductAdditions(const T &iFunc)
ConstProductRegistry & operator=(ConstProductRegistry const &)=delete
ConstProductRegistry(SignallingProductRegistry &iReg)
std::vector< std::string > allBranchNames() const
HLT enums.
std::vector< BranchDescription const * > allBranchDescriptions() const
long double T
ProductList const & productList() const
void connect_but_block_self(Signal &oSignal, const Func &iFunc)