CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ServiceWrapper.h
Go to the documentation of this file.
1 #ifndef ServiceRegistry_ServiceWrapper_h
2 #define ServiceRegistry_ServiceWrapper_h
3 // -*- C++ -*-
4 //
5 // Package: ServiceRegistry
6 // Class : ServiceWrapper
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Sep 5 13:33:01 EDT 2005
19 // $Id: ServiceWrapper.h,v 1.2 2005/09/10 02:08:48 wmtan Exp $
20 //
21 
22 // system include files
23 #include <memory>
24 
25 // user include files
27 
28 // forward declarations
29 namespace edm {
30  class ParameterSet;
31  class ActivityRegistry;
32 
33  namespace serviceregistry {
34 
35  template< class T>
36  class ServiceWrapper : public ServiceWrapperBase
37  {
38 
39 public:
40  ServiceWrapper(std::auto_ptr<T> iService) :
41  service_(iService) {}
42  //virtual ~ServiceWrapper();
43 
44  // ---------- const member functions ---------------------
45  T& get() const { return *service_; }
46 
47  // ---------- static member functions --------------------
48 
49  // ---------- member functions ---------------------------
50 
51 private:
52  ServiceWrapper(const ServiceWrapper&); // stop default
53 
54  const ServiceWrapper& operator=(const ServiceWrapper&); // stop default
55 
56  // ---------- member data --------------------------------
57  std::auto_ptr<T> service_;
58 
59  };
60  }
61 }
62 
63 #endif
const ServiceWrapper & operator=(const ServiceWrapper &)
ServiceWrapper(std::auto_ptr< T > iService)