CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventSetupRecordProviderTemplate.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EventSetupRecordProviderTemplate_h
2 #define FWCore_Framework_EventSetupRecordProviderTemplate_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : EventSetupRecordProviderTemplate
7 //
17 //
18 // Author: Chris Jones
19 // Created: Mon Mar 28 11:43:05 EST 2005
20 //
21 
22 // system include files
23 #include "boost/type_traits/is_base_and_derived.hpp"
24 #include "boost/mpl/begin_end.hpp"
25 #include "boost/mpl/deref.hpp"
26 #include "boost/mpl/next.hpp"
27 
28 // user include files
32 
33 // forward declarations
34 namespace edm {
35  namespace eventsetup {
36 
37  //If the types are the same, stop the recursion
38  template <typename T>
40  const T*,
41  std::set<EventSetupRecordKey>&) { }
42 
43  //Recursively desend container while adding first type's info to set
44  template< typename TFirst, typename TEnd>
45  void addRecordToDependencies(const TFirst*, const TEnd* iEnd,
46  std::set<EventSetupRecordKey>& oSet) {
48  const typename boost::mpl::next< TFirst >::type * next(0);
49  addRecordToDependencies(next, iEnd, oSet);
50  }
51 
52  //Handle the case where a Record has dependencies
53  template <typename T>
55  inline static void dependentRecords(std::set<EventSetupRecordKey>& oSet) {
56  typedef typename T::list_type list_type;
57  const typename boost::mpl::begin<list_type>::type * begin(0);
58  const typename boost::mpl::end<list_type>::type * end(0);
59  addRecordToDependencies(begin, end, oSet);
60  }
61  };
62 
63  //Handle the case where a Record has no dependencies
65  inline static void dependentRecords(std::set<EventSetupRecordKey>&) {
66  }
67  };
68 
69  template <typename T>
70  std::set<EventSetupRecordKey>
75  std::set<EventSetupRecordKey> returnValue;
76  DepFinder::dependentRecords(returnValue);
77  return returnValue;
78  }
79 
80 
81  template<class T>
83  {
84 
85  public:
86  typedef T RecordType;
88 
90  //virtual ~EventSetupRecordProviderTemplate();
91 
92  // ---------- const member functions ---------------------
93  EventSetupRecord const& record() const {return record_;}
94 
95  // ---------- static member functions --------------------
96 
97  // ---------- member functions ---------------------------
98  std::set<EventSetupRecordKey> dependentRecords() const {
99  return findDependentRecordsFor<T>();
100  }
101  protected:
103 
104  private:
106 
108 
109  // ---------- member data --------------------------------
111  };
112 
113  }
114 }
115 #endif
type
Definition: HCALResponse.h:22
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:38
EventSetupRecordProviderTemplate const & operator=(EventSetupRecordProviderTemplate const &)
#define begin
Definition: vmac.h:31
static EventSetupRecordKey makeKey()
std::set< EventSetupRecordKey > dependentRecords() const
Returns the list of Records the provided Record depends on (usually none)
long double T