Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-12-13 03:12:15

0001 #ifndef FWCore_Services_monitor_file_utilities_h
0002 #define FWCore_Services_monitor_file_utilities_h
0003 
0004 #include <iomanip>
0005 #include <iostream>
0006 #include <vector>
0007 
0008 #include "FWCore/ServiceRegistry/interface/StreamContext.h"
0009 #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
0010 #include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h"
0011 #include "DataFormats/Provenance/interface/ModuleDescription.h"
0012 #include "FWCore/Framework/interface/ComponentDescription.h"
0013 
0014 namespace edm::service::monitor_file_utilities {
0015 
0016   inline auto stream_id(edm::StreamContext const& cs) { return cs.streamID().value(); }
0017 
0018   inline auto module_id(edm::ModuleCallingContext const& mcc) { return mcc.moduleDescription()->id(); }
0019 
0020   inline auto module_id(edm::ESModuleCallingContext const& mcc) { return mcc.componentDescription()->id_; }
0021 
0022   inline auto module_callid(edm::ModuleCallingContext const& mcc) { return mcc.callID(); }
0023 
0024   inline auto module_callid(edm::ESModuleCallingContext const& mcc) { return mcc.callID(); }
0025 
0026   template <typename T>
0027   std::enable_if_t<std::is_integral<T>::value> concatenate(std::ostream& os, T const t) {
0028     os << ' ' << t;
0029   }
0030 
0031   template <typename H, typename... T>
0032   std::enable_if_t<std::is_integral<H>::value> concatenate(std::ostream& os, H const h, T const... t) {
0033     os << ' ' << h;
0034     concatenate(os, t...);
0035   }
0036 
0037   void moduleIdToLabel(std::ostream&,
0038                        std::vector<std::string> const& iModules,
0039                        char moduleIdSymbol,
0040                        std::string const& iIDHeader,
0041                        std::string const& iLabelHeader);
0042 }  // namespace edm::service::monitor_file_utilities
0043 #endif