File indexing completed on 2024-04-06 12:11:55
0001 #ifndef FWCore_Common_ProcessBlockHelperBase_h
0002 #define FWCore_Common_ProcessBlockHelperBase_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "DataFormats/Provenance/interface/ProvenanceFwd.h"
0011 #include "FWCore/Utilities/interface/FWCoreUtiliesFwd.h"
0012
0013 #include <string>
0014 #include <vector>
0015
0016 namespace edm {
0017
0018 class ProcessBlockHelperBase {
0019 public:
0020 virtual ~ProcessBlockHelperBase();
0021
0022 std::vector<std::string> const& processesWithProcessBlockProducts() const {
0023 return processesWithProcessBlockProducts_;
0024 }
0025 void setProcessesWithProcessBlockProducts(std::vector<std::string> const& val) {
0026 processesWithProcessBlockProducts_ = val;
0027 }
0028 void emplaceBackProcessName(std::string const& processName) {
0029 processesWithProcessBlockProducts_.emplace_back(processName);
0030 }
0031
0032 std::vector<std::string> const& addedProcesses() const { return addedProcesses_; }
0033 void setAddedProcesses(std::vector<std::string> const& val) { addedProcesses_ = val; }
0034 void emplaceBackAddedProcessName(std::string const& processName) { addedProcesses_.emplace_back(processName); }
0035
0036 void updateForNewProcess(ProductRegistry const&, std::string const& processName);
0037
0038
0039
0040
0041 virtual ProcessBlockHelperBase const* topProcessBlockHelper() const = 0;
0042 virtual std::vector<std::string> const& topProcessesWithProcessBlockProducts() const = 0;
0043 virtual unsigned int nProcessesInFirstFile() const = 0;
0044 virtual std::vector<std::vector<unsigned int>> const& processBlockCacheIndices() const = 0;
0045 virtual std::vector<std::vector<unsigned int>> const& nEntries() const = 0;
0046 virtual std::vector<unsigned int> const& cacheIndexVectorsPerFile() const = 0;
0047 virtual std::vector<unsigned int> const& cacheEntriesPerFile() const = 0;
0048 virtual unsigned int processBlockIndex(std::string const& processName, EventToProcessBlockIndexes const&) const = 0;
0049 virtual unsigned int outerOffset() const = 0;
0050
0051 std::string selectProcess(ProductRegistry const&, ProductLabels const&, TypeID const&) const;
0052
0053 static constexpr unsigned int invalidCacheIndex() { return 0xffffffff; }
0054 static constexpr unsigned int invalidProcessIndex() { return 0xffffffff; }
0055
0056 private:
0057
0058
0059
0060
0061
0062
0063
0064 std::vector<std::string> processesWithProcessBlockProducts_;
0065
0066
0067
0068
0069
0070 std::vector<std::string> addedProcesses_;
0071 };
0072 }
0073 #endif