CMS 3D CMS Logo

findDependentRecordsFor.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_findDependentRecordsFor_h
2 #define FWCore_Framework_findDependentRecordsFor_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : findDependentRecordsFor
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 26 Apr 2018 14:13:06 GMT
19 //
20 
21 // system include files
22 #include <set>
23 #include <type_traits>
24 #include "boost/mpl/begin_end.hpp"
25 #include "boost/mpl/deref.hpp"
26 #include "boost/mpl/next.hpp"
27 
28 // user include files
31 
32 // forward declarations
33 namespace edm {
34  namespace eventsetup {
35 
36  //If the types are the same, stop the recursion
37  template <typename T>
38  void addRecordToDependencies(const T*, const T*, std::set<EventSetupRecordKey>&) {}
39 
40  //Recursively desend container while adding first type's info to set
41  template <typename TFirst, typename TEnd>
42  void addRecordToDependencies(const TFirst*, const TEnd* iEnd, std::set<EventSetupRecordKey>& oSet) {
44  const typename boost::mpl::next<TFirst>::type* next(nullptr);
45  addRecordToDependencies(next, iEnd, oSet);
46  }
47 
48  //Handle the case where a Record has dependencies
49  template <typename T>
51  inline static void dependentRecords(std::set<EventSetupRecordKey>& oSet) {
52  typedef typename T::list_type list_type;
53  const typename boost::mpl::begin<list_type>::type* begin(nullptr);
54  const typename boost::mpl::end<list_type>::type* end(nullptr);
55  addRecordToDependencies(begin, end, oSet);
56  }
57  };
58 
59  //Handle the case where a Record has no dependencies
61  inline static void dependentRecords(std::set<EventSetupRecordKey>&) {}
62  };
63 
64  template <typename T>
65  std::set<EventSetupRecordKey> findDependentRecordsFor() {
69  std::set<EventSetupRecordKey> returnValue;
70  DepFinder::dependentRecords(returnValue);
71  return returnValue;
72  }
73  } // namespace eventsetup
74 } // namespace edm
75 
76 #endif
type
Definition: HCALResponse.h:21
void addRecordToDependencies(const T *, const T *, std::set< EventSetupRecordKey > &)
static void dependentRecords(std::set< EventSetupRecordKey > &oSet)
static void dependentRecords(std::set< EventSetupRecordKey > &)
std::set< EventSetupRecordKey > findDependentRecordsFor()
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
HLT enums.
static EventSetupRecordKey makeKey()
long double T