Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FWCore_Framework_stream_CacheContexts_h
0002 #define FWCore_Framework_stream_CacheContexts_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     FWCore/Framework
0006 // Class  :     CacheContexts
0007 //
0008 /**\class edm::stream::CacheContexts CacheContexts.h "FWCore/Framework/interface/stream/CacheContexts.h"
0009 
0010  Description: Helper class used to identify the caches requested by a module
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri, 02 Aug 2013 00:17:38 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/InputProcessBlockCacheImpl.h"
0025 #include "FWCore/Framework/interface/moduleAbilities.h"
0026 
0027 // forward declarations
0028 namespace edm {
0029   namespace stream {
0030     namespace impl {
0031       struct Last {};
0032 
0033       template <typename T, typename... U>
0034       struct AbilityToCache : public AbilityToCache<U...> {};
0035 
0036       template <typename G, typename... U>
0037       struct AbilityToCache<GlobalCache<G>, U...> : public AbilityToCache<U...> {
0038         using GlobalCache = G;
0039       };
0040 
0041       template <typename... CacheTypes, typename... U>
0042       struct AbilityToCache<InputProcessBlockCache<CacheTypes...>, U...> : public AbilityToCache<U...> {
0043         using InputProcessBlockCache = edm::impl::InputProcessBlockCacheImpl<CacheTypes...>;
0044       };
0045 
0046       template <typename R, typename... U>
0047       struct AbilityToCache<RunCache<R>, U...> : public AbilityToCache<U...> {
0048         using RunCache = R;
0049       };
0050 
0051       template <typename L, typename... U>
0052       struct AbilityToCache<LuminosityBlockCache<L>, U...> : public AbilityToCache<U...> {
0053         using LuminosityBlockCache = L;
0054       };
0055 
0056       template <typename R, typename... U>
0057       struct AbilityToCache<RunSummaryCache<R>, U...> : public AbilityToCache<U...> {
0058         using RunSummaryCache = R;
0059       };
0060 
0061       template <typename L, typename... U>
0062       struct AbilityToCache<LuminosityBlockSummaryCache<L>, U...> : public AbilityToCache<U...> {
0063         using LuminosityBlockSummaryCache = L;
0064       };
0065 
0066       template <>
0067       struct AbilityToCache<Last> {
0068         using GlobalCache = void;
0069         using InputProcessBlockCache = void;
0070         using RunCache = void;
0071         using LuminosityBlockCache = void;
0072         using RunSummaryCache = void;
0073         using LuminosityBlockSummaryCache = void;
0074       };
0075 
0076     }  // namespace impl
0077     template <typename... T>
0078     struct CacheContexts : public impl::AbilityToCache<T..., impl::Last> {};
0079   }  // namespace stream
0080 }  // namespace edm
0081 
0082 #endif