CMS 3D CMS Logo

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 //
20 
21 // system include files
22 #include <memory>
23 
24 // 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  public:
38  ServiceWrapper(std::unique_ptr<T> iService) : service_(std::move(iService)) {}
39  //virtual ~ServiceWrapper();
40 
41  // ---------- const member functions ---------------------
42  T const& get() const { return *service_; }
43 
44  // ---------- static member functions --------------------
45 
46  // ---------- member functions ---------------------------
47  T& get() { return *service_; }
48 
49  private:
50  ServiceWrapper(const ServiceWrapper&) = delete; // stop default
51 
52  const ServiceWrapper& operator=(const ServiceWrapper&) = delete; // stop default
53 
54  // ---------- member data --------------------------------
56  };
57  } // namespace serviceregistry
58 } // namespace edm
59 
60 #endif
const ServiceWrapper & operator=(const ServiceWrapper &)=delete
ServiceWrapper(std::unique_ptr< T > iService)
HLT enums.
long double T
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::unique_ptr< T > > service_