Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:59

0001 #ifndef FWCore_Framework_AbilityChecker_h
0002 #define FWCore_Framework_AbilityChecker_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     AbilityChecker
0007 //
0008 /**\class edm::stream::AbilityChecker AbilityChecker.h "FWCore/Framework/interface/stream/AbilityChecker.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Sat, 03 Aug 2013 15:38:02 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/moduleAbilities.h"
0025 #include "FWCore/Framework/interface/stream/moduleAbilities.h"
0026 
0027 // forward declarations
0028 namespace edm {
0029   namespace stream {
0030     namespace impl {
0031       struct LastCheck {};
0032 
0033       template <typename T, typename... U>
0034       struct HasAbility;
0035 
0036       template <typename G, typename... U>
0037       struct HasAbility<GlobalCache<G>, U...> : public HasAbility<U...> {
0038         static constexpr bool kGlobalCache = true;
0039       };
0040 
0041       template <typename... CacheTypes, typename... U>
0042       struct HasAbility<InputProcessBlockCache<CacheTypes...>, U...> : public HasAbility<U...> {
0043         static constexpr bool kInputProcessBlockCache = true;
0044       };
0045 
0046       template <typename R, typename... U>
0047       struct HasAbility<RunCache<R>, U...> : public HasAbility<U...> {
0048         static constexpr bool kRunCache = true;
0049       };
0050 
0051       template <typename R, typename... U>
0052       struct HasAbility<LuminosityBlockCache<R>, U...> : public HasAbility<U...> {
0053         static constexpr bool kLuminosityBlockCache = true;
0054       };
0055 
0056       template <typename R, typename... U>
0057       struct HasAbility<RunSummaryCache<R>, U...> : public HasAbility<U...> {
0058         static constexpr bool kRunSummaryCache = true;
0059       };
0060 
0061       template <typename R, typename... U>
0062       struct HasAbility<LuminosityBlockSummaryCache<R>, U...> : public HasAbility<U...> {
0063         static constexpr bool kLuminosityBlockSummaryCache = true;
0064       };
0065 
0066       template <typename... U>
0067       struct HasAbility<edm::WatchProcessBlock, U...> : public HasAbility<U...> {
0068         static constexpr bool kWatchProcessBlock = true;
0069       };
0070 
0071       template <typename... U>
0072       struct HasAbility<edm::BeginProcessBlockProducer, U...> : public HasAbility<U...> {
0073         static constexpr bool kBeginProcessBlockProducer = true;
0074       };
0075 
0076       template <typename... U>
0077       struct HasAbility<edm::EndProcessBlockProducer, U...> : public HasAbility<U...> {
0078         static constexpr bool kEndProcessBlockProducer = true;
0079       };
0080 
0081       template <typename... U>
0082       struct HasAbility<edm::BeginRunProducer, U...> : public HasAbility<U...> {
0083         static constexpr bool kBeginRunProducer = true;
0084       };
0085 
0086       template <typename... U>
0087       struct HasAbility<edm::EndRunProducer, U...> : public HasAbility<U...> {
0088         static constexpr bool kEndRunProducer = true;
0089       };
0090 
0091       template <typename... U>
0092       struct HasAbility<edm::BeginLuminosityBlockProducer, U...> : public HasAbility<U...> {
0093         static constexpr bool kBeginLuminosityBlockProducer = true;
0094       };
0095 
0096       template <typename... U>
0097       struct HasAbility<edm::EndLuminosityBlockProducer, U...> : public HasAbility<U...> {
0098         static constexpr bool kEndLuminosityBlockProducer = true;
0099       };
0100 
0101       template <typename... U>
0102       struct HasAbility<edm::ExternalWork, U...> : public HasAbility<U...> {
0103         static constexpr bool kExternalWork = true;
0104       };
0105 
0106       template <typename... U>
0107       struct HasAbility<edm::Transformer, U...> : public HasAbility<U...> {
0108         static constexpr bool kTransformer = true;
0109       };
0110 
0111       template <typename... U>
0112       struct HasAbility<edm::Accumulator, U...> : public HasAbility<U...> {
0113         static constexpr bool kAccumulator = true;
0114       };
0115 
0116       template <typename... U>
0117       struct HasAbility<edm::stream::WatchLuminosityBlocks, U...> : public HasAbility<U...> {
0118         static constexpr bool kWatchLuminosityBlocks = true;
0119       };
0120 
0121       template <typename... U>
0122       struct HasAbility<edm::stream::WatchRuns, U...> : public HasAbility<U...> {
0123         static constexpr bool kWatchRuns = true;
0124       };
0125 
0126       template <>
0127       struct HasAbility<LastCheck> {
0128         static constexpr bool kGlobalCache = false;
0129         static constexpr bool kInputProcessBlockCache = false;
0130         static constexpr bool kRunCache = false;
0131         static constexpr bool kLuminosityBlockCache = false;
0132         static constexpr bool kRunSummaryCache = false;
0133         static constexpr bool kLuminosityBlockSummaryCache = false;
0134         static constexpr bool kWatchProcessBlock = false;
0135         static constexpr bool kBeginProcessBlockProducer = false;
0136         static constexpr bool kEndProcessBlockProducer = false;
0137         static constexpr bool kBeginRunProducer = false;
0138         static constexpr bool kEndRunProducer = false;
0139         static constexpr bool kBeginLuminosityBlockProducer = false;
0140         static constexpr bool kEndLuminosityBlockProducer = false;
0141         static constexpr bool kExternalWork = false;
0142         static constexpr bool kAccumulator = false;
0143         static constexpr bool kTransformer = false;
0144         static constexpr bool kWatchLuminosityBlocks = true;
0145         static constexpr bool kWatchRuns = true;
0146       };
0147     }  // namespace impl
0148     template <typename... T>
0149     struct AbilityChecker : public impl::HasAbility<T..., impl::LastCheck> {};
0150   }  // namespace stream
0151 }  // namespace edm
0152 
0153 #endif