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>
50  typedef T Type;
51  };
52 
53  template <typename T>
54  struct RunCache {
56  typedef T Type;
57  };
58 
59  template <typename T>
62  typedef T Type;
63  };
64 
65  template <typename T>
66  struct RunSummaryCache {
68  typedef T Type;
69  };
70 
71  template <typename T>
74  typedef T Type;
75  };
76 
80  };
81 
85  };
86 
90  };
91 
95  };
96 
97  struct EndRunProducer {
100  };
101 
105  };
106 
110  };
111 
115  };
116 
117  struct ExternalWork {
120  };
121 
122  struct Accumulator {
125  };
126 
127  //Recursively checks VArgs template arguments looking for the ABILITY
128  template <module::Abilities ABILITY, typename... VArgs>
129  struct CheckAbility;
130 
131  template <module::Abilities ABILITY, typename T, typename... VArgs>
132  struct CheckAbility<ABILITY, T, VArgs...> {
133  static constexpr bool kHasIt = (T::kAbilities == ABILITY) | CheckAbility<ABILITY, VArgs...>::kHasIt;
134  typedef std::
135  conditional_t<(T::kAbilities == ABILITY), typename T::Type, typename CheckAbility<ABILITY, VArgs...>::Type>
137  };
138 
139  //End of the recursion
140  template <module::Abilities ABILITY>
141  struct CheckAbility<ABILITY> {
142  static constexpr bool kHasIt = false;
144  };
145 
146  template <typename... VArgs>
148  static constexpr bool value = CheckAbility<module::Abilities::kWatchProcessBlock, VArgs...>::kHasIt or
151  };
152 
153  template <typename... VArgs>
155  static constexpr bool value = CheckAbility<module::Abilities::kInputProcessBlockCache, VArgs...>::kHasIt;
156  };
157 
158  template <typename... VArgs>
160  static constexpr bool value = CheckAbility<module::Abilities::kRunCache, VArgs...>::kHasIt or
164  };
165 
166  template <typename... VArgs>
168  static constexpr bool value = CheckAbility<module::Abilities::kLuminosityBlockCache, VArgs...>::kHasIt or
172  };
173 
174  template <typename... VArgs>
176  static constexpr bool value = CheckAbility<module::Abilities::kStreamCache, VArgs...>::kHasIt or
178  };
179 
180  template <typename... VArgs>
182  static constexpr bool value = CheckAbility<module::Abilities::kStreamCache, VArgs...>::kHasIt or
184  };
185 
186  template <typename... VArgs>
188  static constexpr bool value = CheckAbility<module::Abilities::kBeginProcessBlockProducer, VArgs...>::kHasIt;
189  };
190 
191  template <typename... VArgs>
193  static constexpr bool value = CheckAbility<module::Abilities::kEndProcessBlockProducer, VArgs...>::kHasIt;
194  };
195 
196  template <typename... VArgs>
198  static constexpr bool value = CheckAbility<module::Abilities::kBeginRunProducer, VArgs...>::kHasIt;
199  };
200 
201  template <typename... VArgs>
203  static constexpr bool value = CheckAbility<module::Abilities::kEndRunProducer, VArgs...>::kHasIt;
204  };
205 
206  template <typename... VArgs>
208  static constexpr bool value = CheckAbility<module::Abilities::kBeginLuminosityBlockProducer, VArgs...>::kHasIt;
209  };
210 
211  template <typename... VArgs>
213  static constexpr bool value = CheckAbility<module::Abilities::kEndLuminosityBlockProducer, VArgs...>::kHasIt;
214  };
215 
216 } // namespace edm
217 
218 #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:103
edm::BeginProcessBlockProducer
Definition: moduleAbilities.h:82
edm::EndLuminosityBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:109
edm::GlobalCache::Type
T Type
Definition: moduleAbilities.h:38
edm::InputProcessBlockCache::Type
T Type
Definition: moduleAbilities.h:50
edm::BeginLuminosityBlockProducer
Definition: moduleAbilities.h:102
edm::module::Abilities::kRunCache
edm::WatchProcessBlock::Type
module::Empty Type
Definition: moduleAbilities.h:79
edm::BeginRunProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:93
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::module::Abilities::kExternalWork
edm::HasAbilityToProduceInEndRuns
Definition: moduleAbilities.h:202
edm::InputProcessBlockCache
Definition: moduleAbilities.h:48
edm::CheckAbility
Definition: moduleAbilities.h:129
edm::HasAbilityToProduceInEndLumis
Definition: moduleAbilities.h:212
edm::Accumulator::Type
module::Empty Type
Definition: moduleAbilities.h:124
edm::WatchInputFiles
Definition: moduleAbilities.h:112
edm::BeginLuminosityBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:104
edm::RunCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:55
edm::LuminosityBlockSummaryCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:73
edm::EndRunProducer::Type
module::Empty Type
Definition: moduleAbilities.h:99
edm::InputProcessBlockCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:49
edm::module::Abilities::kWatchInputFiles
edm::WantsGlobalLuminosityBlockTransitions
Definition: moduleAbilities.h:167
edm::BeginProcessBlockProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:83
moduleAbilityEnums.h
edm::EndLuminosityBlockProducer
Definition: moduleAbilities.h:107
edm::module::Abilities::kWatchProcessBlock
susybsm::HSCParticleType::Type
Type
Definition: HSCParticle.h:20
edm::LuminosityBlockCache
Definition: moduleAbilities.h:60
edm::WantsGlobalRunTransitions
Definition: moduleAbilities.h:159
edm::RunSummaryCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:67
edm::module::Empty
Definition: moduleAbilities.h:32
edm::Accumulator
Definition: moduleAbilities.h:122
edm::module::Abilities::kBeginRunProducer
edm::module::Abilities::kRunSummaryCache
edm::LuminosityBlockSummaryCache
Definition: moduleAbilities.h:72
edm::WantsInputProcessBlockTransitions
Definition: moduleAbilities.h:154
edm::module::Abilities::kLuminosityBlockCache
edm::RunCache::Type
T Type
Definition: moduleAbilities.h:56
edm::HasAbilityToProduceInBeginLumis
Definition: moduleAbilities.h:207
edm::module::Abilities::kInputProcessBlockCache
edm::RunCache
Definition: moduleAbilities.h:54
edm::ExternalWork::Type
module::Empty Type
Definition: moduleAbilities.h:119
edm::WatchProcessBlock::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:78
edm::BeginRunProducer
Definition: moduleAbilities.h:92
edm::Accumulator::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:123
edm::BeginRunProducer::Type
module::Empty Type
Definition: moduleAbilities.h:94
edm::EndRunProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:98
edm::module::Abilities::kEndRunProducer
edm::module::Abilities::kBeginLuminosityBlockProducer
edm::WantsStreamLuminosityBlockTransitions
Definition: moduleAbilities.h:181
edm::EndLuminosityBlockProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:108
edm::ExternalWork
Definition: moduleAbilities.h:117
edm::WantsProcessBlockTransitions
Definition: moduleAbilities.h:147
edm::EndProcessBlockProducer
Definition: moduleAbilities.h:87
value
Definition: value.py:1
edm::module::Abilities
Abilities
Definition: moduleAbilityEnums.h:30
edm::LuminosityBlockCache::Type
T Type
Definition: moduleAbilities.h:62
edm::HasAbilityToProduceInBeginProcessBlocks
Definition: moduleAbilities.h:187
edm::module::Abilities::kLuminosityBlockSummaryCache
edm::HasAbilityToProduceInEndProcessBlocks
Definition: moduleAbilities.h:192
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:113
edm::WantsStreamRunTransitions
Definition: moduleAbilities.h:175
edm::BeginProcessBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:84
edm::RunSummaryCache
Definition: moduleAbilities.h:66
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:136
edm::RunSummaryCache::Type
T Type
Definition: moduleAbilities.h:68
edm::LuminosityBlockSummaryCache::Type
T Type
Definition: moduleAbilities.h:74
edm::module::Abilities::kStreamCache
edm::CheckAbility< ABILITY >::Type
edm::module::Empty Type
Definition: moduleAbilities.h:143
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:118
edm::module::Abilities::kGlobalCache
edm::EndRunProducer
Definition: moduleAbilities.h:97
edm::module::Abilities::kEndLuminosityBlockProducer
edm::WatchProcessBlock
Definition: moduleAbilities.h:77
edm::HasAbilityToProduceInBeginRuns
Definition: moduleAbilities.h:197
edm::LuminosityBlockCache::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:61
edm::EndProcessBlockProducer::kAbilities
static constexpr module::Abilities kAbilities
Definition: moduleAbilities.h:88
edm::WatchInputFiles::Type
module::Empty Type
Definition: moduleAbilities.h:114
edm::module::Abilities::kBeginProcessBlockProducer
edm::EndProcessBlockProducer::Type
module::Empty Type
Definition: moduleAbilities.h:89
edm::module::Abilities::kEndProcessBlockProducer