CMS 3D CMS Logo

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 //
20 
21 // system include files
22 #include <type_traits>
23 
24 // user include files
26 
27 // forward declarations
28 
29 namespace edm {
30  namespace module {
31  //Used in the case where ability is not available
32  struct Empty {};
33  } // namespace module
34 
35  template <typename T>
36  struct GlobalCache {
38  typedef T Type;
39  };
40 
41  template <typename T>
42  struct StreamCache {
44  typedef T Type;
45  };
46 
47  template <typename T>
48  struct RunCache {
50  typedef T Type;
51  };
52 
53  template <typename T>
56  typedef T Type;
57  };
58 
59  template <typename T>
60  struct RunSummaryCache {
62  typedef T Type;
63  };
64 
65  template <typename T>
68  typedef T Type;
69  };
70 
74  };
75 
76  struct EndRunProducer {
79  };
80 
84  };
85 
89  };
90 
91  struct WatchInputFiles {
94  };
95 
96  struct ExternalWork {
99  };
100 
101  struct Accumulator {
104  };
105 
106  //Recursively checks VArgs template arguments looking for the ABILITY
107  template <module::Abilities ABILITY, typename... VArgs>
108  struct CheckAbility;
109 
110  template <module::Abilities ABILITY, typename T, typename... VArgs>
111  struct CheckAbility<ABILITY, T, VArgs...> {
112  static constexpr bool kHasIt = (T::kAbilities == ABILITY) | CheckAbility<ABILITY, VArgs...>::kHasIt;
113  typedef std::
114  conditional_t<(T::kAbilities == ABILITY), typename T::Type, typename CheckAbility<ABILITY, VArgs...>::Type>
116  };
117 
118  //End of the recursion
119  template <module::Abilities ABILITY>
120  struct CheckAbility<ABILITY> {
121  static constexpr bool kHasIt = false;
123  };
124 
125  template <typename... VArgs>
127  static constexpr bool value = CheckAbility<module::Abilities::kRunCache, VArgs...>::kHasIt or
131  };
132 
133  template <typename... VArgs>
135  static constexpr bool value = CheckAbility<module::Abilities::kLuminosityBlockCache, VArgs...>::kHasIt or
139  };
140 
141  template <typename... VArgs>
143  static constexpr bool value = CheckAbility<module::Abilities::kStreamCache, VArgs...>::kHasIt or
145  };
146 
147  template <typename... VArgs>
149  static constexpr bool value = CheckAbility<module::Abilities::kStreamCache, VArgs...>::kHasIt or
151  };
152 
153  template <typename... VArgs>
155  static constexpr bool value = CheckAbility<module::Abilities::kBeginRunProducer, VArgs...>::kHasIt or
157  };
158 
159  template <typename... VArgs>
161  static constexpr bool value = CheckAbility<module::Abilities::kBeginRunProducer, VArgs...>::kHasIt;
162  };
163 
164  template <typename... VArgs>
166  static constexpr bool value = CheckAbility<module::Abilities::kEndRunProducer, VArgs...>::kHasIt;
167  };
168 
169  template <typename... VArgs>
171  static constexpr bool value = CheckAbility<module::Abilities::kBeginLuminosityBlockProducer, VArgs...>::kHasIt or
173  };
174 
175  template <typename... VArgs>
177  static constexpr bool value = CheckAbility<module::Abilities::kBeginLuminosityBlockProducer, VArgs...>::kHasIt;
178  };
179 
180  template <typename... VArgs>
182  static constexpr bool value = CheckAbility<module::Abilities::kEndLuminosityBlockProducer, VArgs...>::kHasIt;
183  };
184 
185 } // namespace edm
186 
187 #endif
edm::GlobalCache
Definition: moduleAbilities.h:36
edm::StreamCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:43
edm::BeginLuminosityBlockProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:82
edm::EndLuminosityBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:88
edm::GlobalCache::Type
T Type
Definition: moduleAbilities.h:38
edm::BeginLuminosityBlockProducer
Definition: moduleAbilities.h:81
edm::module::Abilities::kRunCache
edm::BeginRunProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:72
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::module::Abilities::kExternalWork
edm::HasAbilityToProduceInEndRuns
Definition: moduleAbilities.h:165
edm::CheckAbility
Definition: moduleAbilities.h:108
edm::HasAbilityToProduceInEndLumis
Definition: moduleAbilities.h:181
edm::Accumulator::Type
module::Empty Type
Definition: moduleAbilities.h:103
edm::WatchInputFiles
Definition: moduleAbilities.h:91
edm::BeginLuminosityBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:83
edm::RunCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:49
edm::LuminosityBlockSummaryCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:67
edm::EndRunProducer::Type
module::Empty Type
Definition: moduleAbilities.h:78
edm::module::Abilities::kWatchInputFiles
edm::WantsGlobalLuminosityBlockTransitions
Definition: moduleAbilities.h:134
moduleAbilityEnums.h
edm::EndLuminosityBlockProducer
Definition: moduleAbilities.h:86
susybsm::HSCParticleType::Type
Type
Definition: HSCParticle.h:20
edm::LuminosityBlockCache
Definition: moduleAbilities.h:54
edm::WantsGlobalRunTransitions
Definition: moduleAbilities.h:126
edm::RunSummaryCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:61
edm::module::Empty
Definition: moduleAbilities.h:32
edm::Accumulator
Definition: moduleAbilities.h:101
edm::module::Abilities::kBeginRunProducer
edm::module::Abilities::kRunSummaryCache
edm::LuminosityBlockSummaryCache
Definition: moduleAbilities.h:66
edm::module::Abilities::kLuminosityBlockCache
edm::RunCache::Type
T Type
Definition: moduleAbilities.h:50
edm::HasAbilityToProduceInBeginLumis
Definition: moduleAbilities.h:176
edm::RunCache
Definition: moduleAbilities.h:48
edm::ExternalWork::Type
module::Empty Type
Definition: moduleAbilities.h:98
edm::BeginRunProducer
Definition: moduleAbilities.h:71
edm::Accumulator::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:102
edm::BeginRunProducer::Type
module::Empty Type
Definition: moduleAbilities.h:73
edm::HasAbilityToProduceInRuns
Definition: moduleAbilities.h:154
edm::EndRunProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:77
edm::module::Abilities::kEndRunProducer
edm::module::Abilities::kBeginLuminosityBlockProducer
edm::WantsStreamLuminosityBlockTransitions
Definition: moduleAbilities.h:148
edm::EndLuminosityBlockProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:87
edm::ExternalWork
Definition: moduleAbilities.h:96
value
Definition: value.py:1
edm::module::Abilities
Abilities
Definition: moduleAbilityEnums.h:30
module
Definition: vlib.h:198
edm::LuminosityBlockCache::Type
T Type
Definition: moduleAbilities.h:56
edm::HasAbilityToProduceInLumis
Definition: moduleAbilities.h:170
edm::module::Abilities::kLuminosityBlockSummaryCache
edm::StreamCache
Definition: moduleAbilities.h:42
edm::module::Abilities::kAccumulator
edm::StreamCache::Type
T Type
Definition: moduleAbilities.h:44
edm::GlobalCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:37
edm::WatchInputFiles::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:92
edm::WantsStreamRunTransitions
Definition: moduleAbilities.h:142
edm::RunSummaryCache
Definition: moduleAbilities.h:60
T
long double T
Definition: Basic3DVectorLD.h:48
edm::CheckAbility< ABILITY, T, VArgs... >::Type
std::conditional_t<(T::kAbilities==ABILITY), typename T::Type, typename CheckAbility< ABILITY, VArgs... >::Type > Type
Definition: moduleAbilities.h:115
edm::RunSummaryCache::Type
T Type
Definition: moduleAbilities.h:62
edm::LuminosityBlockSummaryCache::Type
T Type
Definition: moduleAbilities.h:68
edm::module::Abilities::kStreamCache
edm::CheckAbility< ABILITY >::Type
edm::module::Empty Type
Definition: moduleAbilities.h:122
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ExternalWork::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:97
edm::module::Abilities::kGlobalCache
edm::EndRunProducer
Definition: moduleAbilities.h:76
edm::module::Abilities::kEndLuminosityBlockProducer
edm::HasAbilityToProduceInBeginRuns
Definition: moduleAbilities.h:160
edm::LuminosityBlockCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:55
edm::WatchInputFiles::Type
module::Empty Type
Definition: moduleAbilities.h:93