00001 #ifndef Framework_ConstProductRegistry_h 00002 #define Framework_ConstProductRegistry_h 00003 // -*- C++ -*- 00004 // 00005 // Package: Framework 00006 // Class : ConstProductRegistry 00007 // 00016 // 00017 // Original Author: Chris Jones 00018 // Created: Thu Sep 22 18:01:21 CEST 2005 00019 // 00020 00021 // system include files 00022 #include <vector> 00023 #include <string> 00024 00025 // user include files 00026 #include "FWCore/Framework/src/SignallingProductRegistry.h" 00027 #include "FWCore/ServiceRegistry/interface/connect_but_block_self.h" 00028 00029 // forward declarations 00030 namespace edm { 00031 class ConstProductRegistry 00032 { 00033 00034 public: 00035 typedef ProductRegistry::ProductList ProductList; 00036 00037 ConstProductRegistry(SignallingProductRegistry& iReg) : reg_(&iReg) { } 00038 00039 ConstProductRegistry(ConstProductRegistry const&) = delete; // Disallow copying and moving 00040 ConstProductRegistry& operator=(ConstProductRegistry const&) = delete; // Disallow copying and moving 00041 00042 // ---------- const member functions --------------------- 00043 ProductRegistry const& productRegistry() const {return *reg_;} 00044 00045 ProductList const& productList() const {return reg_->productList();} 00046 00047 // Return all the branch names currently known to *this. This 00048 // does a return-by-value of the vector so that it may be used in 00049 // a colon-initialization list. 00050 std::vector<std::string> allBranchNames() const {return reg_->allBranchNames();} 00051 00052 // Return pointers to (const) BranchDescriptions for all the 00053 // BranchDescriptions known to *this. This does a 00054 // return-by-value of the vector so that it may be used in a 00055 // colon-initialization list. 00056 std::vector<BranchDescription const*> allBranchDescriptions() const {return reg_->allBranchDescriptions();} 00057 00058 bool anyProductProduced() const {return reg_->anyProductProduced();} 00059 00060 template< class T> 00061 void watchProductAdditions(const T& iFunc) 00062 { 00063 serviceregistry::connect_but_block_self(reg_->productAddedSignal_, 00064 iFunc); 00065 } 00066 template< class T, class TMethod> 00067 void watchProductAdditions(T const& iObj, TMethod iMethod) 00068 { 00069 serviceregistry::connect_but_block_self(reg_->productAddedSignal_, 00070 boost::bind(iMethod, iObj,_1)); 00071 } 00072 00073 private: 00074 00075 // ---------- member data -------------------------------- 00076 SignallingProductRegistry* reg_; 00077 }; 00078 } 00079 00080 #endif