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
edm::serviceregistry::ServiceWrapper::get
T & get()
Definition: ServiceWrapper.h:47
edm::serviceregistry::ServiceWrapper::operator=
const ServiceWrapper & operator=(const ServiceWrapper &)=delete
ServiceWrapperBase.h
ServiceWrapperBase
ActivityRegistry
propagate_const.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::propagate_const
Definition: propagate_const.h:32
edm::serviceregistry::ServiceWrapper::service_
edm::propagate_const< std::unique_ptr< T > > service_
Definition: ServiceWrapper.h:55
ParameterSet
Definition: Functions.h:16
ServiceWrapper
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
T
long double T
Definition: Basic3DVectorLD.h:48
edm::serviceregistry::ServiceWrapper::get
T const & get() const
Definition: ServiceWrapper.h:42
edm::serviceregistry::ServiceWrapper::ServiceWrapper
ServiceWrapper(std::unique_ptr< T > iService)
Definition: ServiceWrapper.h:38
edm::serviceregistry::ServiceWrapper
Definition: ServiceRegistry.h:35