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 #include <vector>
22 #include <string>
23 #include <map>
24 #include <mutex>
25 #include <memory>
26 
29 
30 class testSharedResourcesRegistry;
31 
32 namespace edm {
34 
36  public:
37  //needed for testing
38  friend class ::testSharedResourcesRegistry;
39 
40  SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default
41  const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default
42 
43  SharedResourcesAcquirer createAcquirer(std::vector<std::string> const&) const;
44 
45  std::pair<SharedResourcesAcquirer, std::shared_ptr<std::recursive_mutex>> createAcquirerForSourceDelayedReader();
46 
48 
51 
52 #ifdef SHAREDRESOURCETESTACCESSORS
53  // The next function is intended to be used only in a unit test
54  std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> const& resourceMap() const {
55  return resourceMap_;
56  }
57 #endif
58 
59  private:
61  ~SharedResourcesRegistry() = default;
62 
63  // ---------- member data --------------------------------
64  std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> resourceMap_;
65 
67 
69  };
70 } // namespace edm
71 
72 #endif
edm::propagate_const< std::shared_ptr< SerialTaskQueue > > queueForDelayedReader_
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.
HLT enums.
std::pair< SharedResourcesAcquirer, std::shared_ptr< std::recursive_mutex > > createAcquirerForSourceDelayedReader()
const SharedResourcesRegistry & operator=(const SharedResourcesRegistry &)=delete
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const