CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 //
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  ServiceWrapper(const ServiceWrapper&) = delete; // stop default
40  const ServiceWrapper& operator=(const ServiceWrapper&) = delete; // stop default
41 
42  // ---------- const member functions ---------------------
43  T const& get() const { return *service_; }
44 
45  // ---------- static member functions --------------------
46 
47  // ---------- member functions ---------------------------
48  T& get() { return *service_; }
49 
50  private:
51  // ---------- member data --------------------------------
53  };
54  } // namespace serviceregistry
55 } // namespace edm
56 
57 #endif
const ServiceWrapper & operator=(const ServiceWrapper &)=delete
ServiceWrapper(std::unique_ptr< T > iService)
def move
Definition: eostools.py:511
long double T
edm::propagate_const< std::unique_ptr< T > > service_