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 //
12 
13 // user include files
16 
17 // system include files
18 #include "boost/thread/tss.hpp"
19 
20 namespace edm {
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  // ServiceRegistry::ServiceRegistry(ServiceRegistry const& rhs) {
36  // // do actual copying here;
37  // }
38 
40  }
41 
42  //
43  // assignment operators
44  //
45  // ServiceRegistry const& ServiceRegistry::operator=(ServiceRegistry const& rhs) {
46  // //An exception safe implementation is
47  // ServiceRegistry temp(rhs);
48  // swap(rhs);
49  //
50  // return *this;
51  // }
52 
53  //
54  // member functions
55  //
58  ServiceToken returnValue(manager_);
59  manager_ = iNewToken.manager_;
60  return returnValue;
61  }
62 
63  void
65  manager_ = iOldToken.manager_;
66  }
67 
68  //
69  // const member functions
70  //
73  return manager_;
74  }
75 
76  //
77  // static member functions
78  //
79 
82  boost::shared_ptr<ParameterSet> params;
83  makeParameterSets(config, params);
84 
85  std::auto_ptr<std::vector<ParameterSet> > serviceSets = params->popVParameterSet(std::string("services"));
86  //create the services
87  return ServiceToken(ServiceRegistry::createSet(*serviceSets));
88  }
89 
91  ServiceRegistry::createSet(std::vector<ParameterSet>& iPS) {
92  using namespace serviceregistry;
93  boost::shared_ptr<ServicesManager> returnValue(new ServicesManager(iPS));
94  return ServiceToken(returnValue);
95  }
96 
98  ServiceRegistry::createSet(std::vector<ParameterSet>& iPS,
99  ServiceToken iToken,
101  bool associate) {
102  using namespace serviceregistry;
103  boost::shared_ptr<ServicesManager> returnValue(new ServicesManager(iToken, iLegacy, iPS, associate));
104  return ServiceToken(returnValue);
105  }
106 
109  static boost::thread_specific_ptr<ServiceRegistry> s_registry;
110  if(0 == s_registry.get()){
111  s_registry.reset(new ServiceRegistry);
112  }
113  return *s_registry;
114  }
115 }
ServiceToken setContext(ServiceToken const &iNewToken)
boost::shared_ptr< serviceregistry::ServicesManager > manager_
ServiceToken presentToken() const
static ServiceToken createServicesFromConfig(std::string const &config)
void unsetContext(ServiceToken const &iOldToken)
boost::shared_ptr< edm::serviceregistry::ServicesManager > manager_
Definition: ServiceToken.h:71
static ServiceRegistry & instance()
static ServiceToken createSet(std::vector< ParameterSet > &)
void makeParameterSets(std::string const &configtext, boost::shared_ptr< ParameterSet > &main)
essentially the same as the previous method