CMS 3D CMS Logo

SharedResourcesRegistry.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_SharedResourcesRegistry_h
2 #define FWCore_Framework_SharedResourcesRegistry_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : SharedResourcesRegistry
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sun, 06 Oct 2013 15:48:44 GMT
19 //
20 
21 // system include files
22 #include <vector>
23 #include <string>
24 #include <map>
25 #include <mutex>
26 #include <memory>
27 
30 
31 // user include files
32 
33 // forward declarations
34 class testSharedResourcesRegistry;
35 
36 namespace edm {
38 
40  public:
41  //needed for testing
42  friend class ::testSharedResourcesRegistry;
43 
44  // ---------- const member functions ---------------------
45  SharedResourcesAcquirer createAcquirer(std::vector<std::string> const&) const;
46 
47  std::pair<SharedResourcesAcquirer, std::shared_ptr<std::recursive_mutex>> createAcquirerForSourceDelayedReader();
48 
49  // ---------- static member functions --------------------
51 
54 
55  // ---------- member functions ---------------------------
58 
59 #ifdef SHAREDRESOURCETESTACCESSORS
60  // The next function is intended to be used only in a unit test
61  std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> const& resourceMap() const {
62  return resourceMap_;
63  }
64 #endif
65 
66  private:
68  ~SharedResourcesRegistry() = default;
69 
70  SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default
71 
72  const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default
73 
74  // ---------- member data --------------------------------
75  std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> resourceMap_;
76 
78 
80 
81  unsigned int nLegacy_;
82  };
83 } // namespace edm
84 
85 #endif
edm::propagate_const< std::shared_ptr< SerialTaskQueue > > queueForDelayedReader_
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
static SharedResourcesRegistry * instance()
std::map< std::string, std::pair< std::shared_ptr< SerialTaskQueue >, unsigned int > > resourceMap_
edm::propagate_const< std::shared_ptr< std::recursive_mutex > > resourceForDelayedReader_
void registerSharedResource(const std::string &)
A resource name must be registered before it can be used in the createAcquirer call.
static const std::string kLegacyModuleResourceName
All legacy modules share this resource.
HLT enums.
std::pair< SharedResourcesAcquirer, std::shared_ptr< std::recursive_mutex > > createAcquirerForSourceDelayedReader()
const SharedResourcesRegistry & operator=(const SharedResourcesRegistry &)=delete