CP3-llbb Framework
ProducersManager.h
1 #ifndef PRODUCERS_MANAGER
2 #define PRODUCERS_MANAGER
3 
4 #include "cp3_llbb/Framework/interface/ProducerGetter.h"
5 #include "cp3_llbb/Framework/interface/Producer.h"
6 
7 #include <string>
8 #include <type_traits>
9 
11  friend class ExTreeMaker;
12 
13  public:
14  template <class T>
15  const T& get(const std::string& name) const {
16  static_assert(std::is_base_of<Framework::Producer, T>::value, "T must inherit from Framework::Producer");
17  return dynamic_cast<const T&>(m_getter.getProducer(name));
18  }
19 
20  bool exists(const std::string& name) const;
21 
22  private:
23  ProducersManager(const ProducerGetter& getter);
24  const ProducerGetter& m_getter;
25 
26 };
27 
28 #endif
Definition: Framework.h:21
Definition: ProducerGetter.h:9
Definition: ProducersManager.h:10