Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-22 02:23:56

0001 #ifndef FWCore_Services_moduleAlloc_setupFile_h
0002 #define FWCore_Services_moduleAlloc_setupFile_h
0003 
0004 #include <string>
0005 #include <atomic>
0006 #include <vector>
0007 
0008 namespace edm {
0009   class ActivityRegistry;
0010   namespace service::moduleAlloc {
0011     struct ThreadAllocInfo;
0012 
0013     class Filter {
0014     public:
0015       //a negative module id corresponds to an ES module
0016       Filter(std::vector<int> const* moduleIDs);
0017       //returns true if should keep this
0018       bool startOnThread(int moduleID) const;
0019       const ThreadAllocInfo* stopOnThread(int moduleID) const;
0020 
0021       bool startOnThread() const;
0022       const ThreadAllocInfo* stopOnThread() const;
0023 
0024       void setGlobalKeep(bool iShouldKeep);
0025       bool globalKeep() const { return globalKeep_.load(); }
0026 
0027       bool keepModuleInfo(int moduleID) const;
0028 
0029     private:
0030       std::atomic<bool> globalKeep_ = true;
0031       std::vector<int> const* moduleIDs_ = nullptr;
0032     };
0033     void setupFile(std::string const& iFileName, edm::ActivityRegistry&, Filter const*);
0034   }  // namespace service::moduleAlloc
0035 }  // namespace edm
0036 
0037 #endif