CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/FWCore/ServiceRegistry/interface/ServiceWrapper.h

Go to the documentation of this file.
00001 #ifndef ServiceRegistry_ServiceWrapper_h
00002 #define ServiceRegistry_ServiceWrapper_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     ServiceRegistry
00006 // Class  :     ServiceWrapper
00007 // 
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Mon Sep  5 13:33:01 EDT 2005
00019 // $Id: ServiceWrapper.h,v 1.3 2008/01/17 01:02:01 wmtan Exp $
00020 //
00021 
00022 // system include files
00023 #include <memory>
00024 
00025 // user include files
00026 #include "FWCore/ServiceRegistry/interface/ServiceWrapperBase.h"
00027 
00028 // forward declarations
00029 namespace edm {
00030    class ParameterSet;
00031    class ActivityRegistry;
00032 
00033    namespace serviceregistry {
00034 
00035       template< class T>
00036       class ServiceWrapper : public ServiceWrapperBase
00037       {
00038 
00039 public:
00040          ServiceWrapper(std::auto_ptr<T> iService) :
00041          service_(iService) {}
00042          //virtual ~ServiceWrapper();
00043          
00044          // ---------- const member functions ---------------------
00045          T& get() const { return *service_; }
00046          
00047          // ---------- static member functions --------------------
00048          
00049          // ---------- member functions ---------------------------
00050 
00051 private:
00052          ServiceWrapper(const ServiceWrapper&); // stop default
00053          
00054          const ServiceWrapper& operator=(const ServiceWrapper&); // stop default
00055          
00056          // ---------- member data --------------------------------
00057          std::auto_ptr<T> service_;
00058          
00059       };
00060    }
00061 }
00062 
00063 #endif