CMS 3D CMS Logo

Service.h
Go to the documentation of this file.
1 #ifndef ServiceRegistry_Service_h
2 #define ServiceRegistry_Service_h
3 // -*- C++ -*-
4 //
5 // Package: ServiceRegistry
6 // Class : Service
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Wed Sep 7 15:17:17 EDT 2005
19 //
20 
21 // system include files
22 
23 // user include files
25 
26 // forward declarations
27 
28 namespace edm {
29  template <class T>
30  class Service {
31  public:
32  Service() {}
33  //virtual ~Service();
34 
35  // ---------- const member functions ---------------------
36  T* operator->() const { return &(ServiceRegistry::instance().template get<T>()); }
37 
38  T& operator*() const { return ServiceRegistry::instance().template get<T>(); }
39 
40  bool isAvailable() const { return ServiceRegistry::instance().template isAvailable<T>(); }
41 
42  operator bool() const { return isAvailable(); }
43 
44  // ---------- static member functions --------------------
45 
46  // ---------- member functions ---------------------------
47 
48  private:
49  };
50 
51 } // namespace edm
52 
53 #endif
edm::Service::operator->
T * operator->() const
Definition: Service.h:36
electrons_cff.bool
bool
Definition: electrons_cff.py:372
ServiceRegistry.h
edm::Service::Service
Service()
Definition: Service.h:32
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::Service::operator*
T & operator*() const
Definition: Service.h:38
edm::Service
Definition: Service.h:30
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
T
long double T
Definition: Basic3DVectorLD.h:48