CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  {
34 
35  public:
37 
39 
40  ConstProductRegistry(ConstProductRegistry const&) = delete; // Disallow copying and moving
41  ConstProductRegistry& operator=(ConstProductRegistry const&) = delete; // Disallow copying and moving
42 
43  // ---------- const member functions ---------------------
44  ProductRegistry const& productRegistry() const {return *reg_;}
45 
46  ProductList const& productList() const {return reg_->productList();}
47 
48  // Return all the branch names currently known to *this. This
49  // does a return-by-value of the vector so that it may be used in
50  // a colon-initialization list.
51  std::vector<std::string> allBranchNames() const {return reg_->allBranchNames();}
52 
53  // Return pointers to (const) BranchDescriptions for all the
54  // BranchDescriptions known to *this. This does a
55  // return-by-value of the vector so that it may be used in a
56  // colon-initialization list.
57  std::vector<BranchDescription const*> allBranchDescriptions() const {return reg_->allBranchDescriptions();}
58 
59  bool anyProductProduced() const {return reg_->anyProductProduced();}
60 
61  template< class T>
62  void watchProductAdditions(const T& iFunc)
63  {
64  serviceregistry::connect_but_block_self(reg_->productAddedSignal_,
65  iFunc);
66  }
67  template< class T, class TMethod>
68  void watchProductAdditions(T const& iObj, TMethod iMethod)
69  {
70  using std::placeholders::_1;
71  serviceregistry::connect_but_block_self(reg_->productAddedSignal_,
72  std::bind(iMethod, iObj,_1));
73  }
74 
75  private:
76 
77  // ---------- member data --------------------------------
79  };
80 }
81 
82 #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
std::vector< BranchDescription const * > allBranchDescriptions() const
long double T
ProductList const & productList() const
void connect_but_block_self(Signal &oSignal, const Func &iFunc)