CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
moduleAbilities.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_moduleAbilities_h
2 #define FWCore_Framework_moduleAbilities_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : moduleAbilities
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Tue, 07 May 2013 19:19:53 GMT
19 // $Id: moduleAbilities.h,v 1.1 2013/05/17 14:49:43 chrjones Exp $
20 //
21 
22 // system include files
23 #include "boost/mpl/if.hpp"
24 
25 // user include files
27 
28 // forward declarations
29 
30 namespace edm {
31  namespace module {
32  //Used in the case where ability is not available
33  struct Empty{};
34  }
35 
36  template<typename T>
37  struct GlobalCache {
39  typedef T Type;
40  };
41 
42  template<typename T>
43  struct StreamCache {
45  typedef T Type;
46  };
47 
48  template<typename T>
49  struct RunCache {
51  typedef T Type;
52  };
53 
54  template<typename T>
57  typedef T Type;
58  };
59 
60  template<typename T>
61  struct RunSummaryCache {
63  typedef T Type;
64  };
65 
66  template<typename T>
69  typedef T Type;
70  };
71 
75  };
76 
77  struct EndRunProducer {
80  };
81 
85  };
86 
90  };
91 
92 
93  //Recursively checks VArgs template arguments looking for the ABILITY
94  template<module::Abilities ABILITY, typename... VArgs> struct CheckAbility;
95 
96  template<module::Abilities ABILITY, typename T, typename... VArgs>
97  struct CheckAbility<ABILITY,T,VArgs...> {
98  static constexpr bool kHasIt = (T::kAbilities==ABILITY) | CheckAbility<ABILITY,VArgs...>::kHasIt;
99  typedef typename boost::mpl::if_c<(T::kAbilities==ABILITY),
100  typename T::Type,
102  };
103 
104  //End of the recursion
105  template<module::Abilities ABILITY>
106  struct CheckAbility<ABILITY> {
107  static constexpr bool kHasIt=false;
109  };
110 
111 }
112 
113 #endif
static constexpr module::Abilities kAbilities
type
Definition: HCALResponse.h:21
module::Empty Type
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
static constexpr module::Abilities kAbilities
boost::mpl::if_c<(T::kAbilities==ABILITY), typename T::Type, typename CheckAbility< ABILITY, VArgs...>::Type >::type Type
static constexpr module::Abilities kAbilities
long double T
Definition: vlib.h:209
#define constexpr