CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ECGetterBase.h
Go to the documentation of this file.
1 #ifndef Utilities_ECGetterBase_h
2 #define Utilities_ECGetterBase_h
3 // -*- C++ -*-
4 //
5 // Package: Utilities
6 // Class : ECGetterBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri Sep 22 12:41:05 EDT 2006
19 // $Id: ECGetterBase.h,v 1.1 2006/09/22 18:42:58 chrjones Exp $
20 //
21 
22 // system include files
23 
24 // user include files
25 
26 // forward declarations
27 namespace edm {
28  namespace extensioncord {
29  template <class T>
31  {
32 
33  public:
35  virtual ~ECGetterBase() {}
36 
37  // ---------- const member functions ---------------------
38  const T* get() const {
39  if(data_==0) {
40  data_ = this->getImpl();
41  }
42  return data_;
43  }
44 
45  private:
46  //ECGetterBase(const ECGetterBase&); // allow default
47 
48  //const ECGetterBase& operator=(const ECGetterBase&); // allow default
49 
50  //the actual method which is used to get the requested data
51  virtual const T* getImpl() const = 0;
52 
53  // ---------- member data --------------------------------
54  //does not own the data
55  mutable const T* data_;
56 
57  };
58  }
59  template <class T>
61  public:
62  ValueHolderECGetter(const T& iValue) : value_(&iValue) {}
63  private:
64  virtual const T* getImpl() const {
65  return value_;
66  }
67  const T* value_;
68  };
69 }
70 
71 #endif
virtual const T * getImpl() const =0
ValueHolderECGetter(const T &iValue)
Definition: ECGetterBase.h:62
virtual const T * getImpl() const
Definition: ECGetterBase.h:64
long double T