Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:28

0001 #ifndef FWCore_Framework_print_eventsetup_record_dependencies_h
0002 #define FWCore_Framework_print_eventsetup_record_dependencies_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class  :     print_eventsetup_record_dependencies
0007 //
0008 /**\class print_eventsetup_record_dependencies print_eventsetup_record_dependencies.h FWCore/Framework/interface/print_eventsetup_record_dependencies.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Mon Apr 27 13:40:06 CDT 2009
0019 //
0020 
0021 // user include files
0022 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0023 #include "FWCore/Framework/interface/DependentRecordTag.h"
0024 #include "FWCore/Utilities/interface/mplVector.h"
0025 
0026 // system include files
0027 
0028 #include <iostream>
0029 #include <string>
0030 
0031 // forward declarations
0032 
0033 namespace edm {
0034   namespace eventsetup {
0035     struct DependentRecordTag;
0036   }
0037   template <typename RecordT>
0038   void print_eventsetup_record_dependencies(std::ostream& oStream, std::string const& iIndent = std::string());
0039 
0040   template <typename TFirst, typename TRemaining>
0041   void print_eventsetup_record_dependencies(std::ostream& oStream,
0042                                             std::string iIndent,
0043                                             TFirst const*,
0044                                             TRemaining const*) {
0045     iIndent += " ";
0046     print_eventsetup_record_dependencies<TFirst>(oStream, iIndent);
0047 
0048     using Pop = edm::mpl::Pop<TRemaining>;
0049     if constexpr (not Pop::empty) {
0050       const typename Pop::Item* next(nullptr);
0051       const typename Pop::Remaining* remaining(nullptr);
0052 
0053       print_eventsetup_record_dependencies(oStream, iIndent, next, remaining);
0054     }
0055   }
0056 
0057   template <typename RecordT>
0058   void print_eventsetup_record_dependencies(std::ostream& oStream, std::string const& iIndent) {
0059     oStream << iIndent << edm::eventsetup::EventSetupRecordKey::makeKey<RecordT>().name() << std::endl;
0060 
0061     if constexpr (std::is_base_of_v<edm::eventsetup::DependentRecordTag, RecordT>) {
0062       using list_type = typename RecordT::list_type;
0063       using Pop = edm::mpl::Pop<list_type>;
0064 
0065       const typename Pop::Item* begin(nullptr);
0066       const typename Pop::Remaining* remaining(nullptr);
0067 
0068       print_eventsetup_record_dependencies(oStream, iIndent, begin, remaining);
0069     }
0070   }
0071 }  // namespace edm
0072 
0073 #endif