CMS 3D CMS Logo

ServiceRegistry.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ServiceRegistry
4 // Class : ServiceRegistry
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Sep 5 13:33:19 EDT 2005
11 //
12 
13 // user include files
15 
16 // system include files
17 
18 namespace edm {
19  //
20  // constants, enums and typedefs
21  //
22 
23  //
24  // static data member definitions
25  //
26 
27  //
28  // constructors and destructor
29  //
31 
32  // ServiceRegistry::ServiceRegistry(ServiceRegistry const& rhs) {
33  // // do actual copying here;
34  // }
35 
37 
38  //
39  // assignment operators
40  //
41  // ServiceRegistry const& ServiceRegistry::operator=(ServiceRegistry const& rhs) {
42  // //An exception safe implementation is
43  // ServiceRegistry temp(rhs);
44  // swap(rhs);
45  //
46  // return *this;
47  // }
48 
49  //
50  // member functions
51  //
53  ServiceToken returnValue(manager_);
54  manager_ = iNewToken.manager_;
55  return returnValue;
56  }
57 
58  void ServiceRegistry::unsetContext(ServiceToken const& iOldToken) { manager_ = iOldToken.manager_; }
59 
60  //
61  // const member functions
62  //
64 
65  //
66  // static member functions
67  //
68 
70  auto serviceSets = params->popVParameterSet(std::string("services"));
71  //create the services
72  return ServiceToken(ServiceRegistry::createSet(serviceSets));
73  }
74 
75  ServiceToken ServiceRegistry::createSet(std::vector<ParameterSet>& iPS) {
76  using namespace serviceregistry;
77  auto returnValue = std::make_shared<ServicesManager>(iPS);
78  return ServiceToken(returnValue);
79  }
80 
81  ServiceToken ServiceRegistry::createSet(std::vector<ParameterSet>& iPS,
82  ServiceToken iToken,
84  bool associate) {
85  using namespace serviceregistry;
86  auto returnValue = std::make_shared<ServicesManager>(iToken, iLegacy, iPS, associate);
87  return ServiceToken(returnValue);
88  }
89 
91  static thread_local ServiceRegistry s_registry;
92  return s_registry;
93  }
94 } // namespace edm
ServiceRegistry.h
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ServiceRegistry::createSet
static ServiceToken createSet(std::vector< ParameterSet > &)
Definition: ServiceRegistry.cc:75
edm::ServiceRegistry::setContext
ServiceToken setContext(ServiceToken const &iNewToken)
Definition: ServiceRegistry.cc:52
edm::ServiceToken
Definition: ServiceToken.h:40
edm::ServiceRegistry::~ServiceRegistry
virtual ~ServiceRegistry()
Definition: ServiceRegistry.cc:36
edm::ServiceRegistry::manager_
std::shared_ptr< serviceregistry::ServicesManager > manager_
Definition: ServiceRegistry.h:142
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ServiceRegistry::createServicesFromConfig
static ServiceToken createServicesFromConfig(std::unique_ptr< ParameterSet > params)
Definition: ServiceRegistry.cc:69
edm::ServiceRegistry::presentToken
ServiceToken presentToken() const
Definition: ServiceRegistry.cc:63
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
edm::ServiceRegistry::unsetContext
void unsetContext(ServiceToken const &iOldToken)
Definition: ServiceRegistry.cc:58
edm::ServiceToken::manager_
std::shared_ptr< edm::serviceregistry::ServicesManager > manager_
Definition: ServiceToken.h:75
edm::ServiceRegistry
Definition: ServiceRegistry.h:38
edm::ServiceRegistry::ServiceRegistry
ServiceRegistry()
Definition: ServiceRegistry.cc:30
edm::serviceregistry::ServiceLegacy
ServiceLegacy
Definition: ServiceLegacy.h:29