CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: ServiceRegistry.cc,v 1.6 2009/08/26 21:14:05 wdd Exp $
12 //
13 
14 // system include files
15 #include "boost/thread/tss.hpp"
16 
17 // user include files
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
33 {
34 }
35 
36 // ServiceRegistry::ServiceRegistry(const ServiceRegistry& rhs)
37 // {
38 // // do actual copying here;
39 // }
40 
42 {
43 }
44 
45 //
46 // assignment operators
47 //
48 // const ServiceRegistry& ServiceRegistry::operator=(const ServiceRegistry& rhs)
49 // {
50 // //An exception safe implementation is
51 // ServiceRegistry temp(rhs);
52 // swap(rhs);
53 //
54 // return *this;
55 // }
56 
57 //
58 // member functions
59 //
62 {
63  edm::ServiceToken returnValue(manager_);
64  manager_ = iNewToken.manager_;
65  return returnValue;
66 }
67 
68 void
70 {
71  manager_ = iOldToken.manager_;
72 }
73 
74 //
75 // const member functions
76 //
79 {
80  return manager_;
81 }
82 
83 //
84 // static member functions
85 //
86 
89  boost::shared_ptr<std::vector<ParameterSet> > pServiceSets;
90  boost::shared_ptr<ParameterSet> params;
91  edm::makeParameterSets(config, params, pServiceSets);
92 
93  //create the services
94  return ServiceToken(edm::ServiceRegistry::createSet(*pServiceSets.get()));
95 }
96 
98 edm::ServiceRegistry::createSet(std::vector<ParameterSet>& iPS)
99 {
100  using namespace edm::serviceregistry;
101  boost::shared_ptr<ServicesManager> returnValue(new ServicesManager(iPS));
102  return edm::ServiceToken(returnValue);
103 }
105 edm::ServiceRegistry::createSet(std::vector<ParameterSet>& iPS,
106  ServiceToken iToken,
108 {
109  using namespace edm::serviceregistry;
110  boost::shared_ptr<ServicesManager> returnValue(new ServicesManager(iToken,iLegacy,iPS));
111  return edm::ServiceToken(returnValue);
112 }
113 
116 {
117  static boost::thread_specific_ptr<ServiceRegistry> s_registry;
118  if(0 == s_registry.get()){
119  s_registry.reset(new ServiceRegistry);
120  }
121  return *s_registry;
122 }
ServiceToken setContext(const ServiceToken &iNewToken)
static ServiceToken createSet(std::vector< ParameterSet > &)
static ServiceToken createServicesFromConfig(const std::string &config)
static ServiceRegistry & instance()
void unsetContext(const ServiceToken &iOldToken)
boost::shared_ptr< edm::serviceregistry::ServicesManager > manager_
Definition: ServiceToken.h:71
void makeParameterSets(std::string const &configtext, boost::shared_ptr< ParameterSet > &main, boost::shared_ptr< std::vector< ParameterSet > > &serviceparams)
essentially the same as the previous method
tuple config
Definition: cmsDriver.py:17
ServiceToken presentToken() const