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 //
20 
21 // system include files
22 
23 // user include files
24 
25 // forward declarations
26 namespace edm {
27  namespace extensioncord {
28  template <class T>
30  {
31 
32  public:
34  virtual ~ECGetterBase() {}
35 
36  // ---------- const member functions ---------------------
37  const T* get() const {
38  if(data_==0) {
39  data_ = this->getImpl();
40  }
41  return data_;
42  }
43 
44  private:
45  //ECGetterBase(const ECGetterBase&); // allow default
46 
47  //const ECGetterBase& operator=(const ECGetterBase&); // allow default
48 
49  //the actual method which is used to get the requested data
50  virtual const T* getImpl() const = 0;
51 
52  // ---------- member data --------------------------------
53  //does not own the data
54  mutable const T* data_;
55 
56  };
57  }
58  template <class T>
60  public:
61  ValueHolderECGetter(const T& iValue) : value_(&iValue) {}
62  private:
63  virtual const T* getImpl() const {
64  return value_;
65  }
66  const T* value_;
67  };
68 }
69 
70 #endif
virtual const T * getImpl() const =0
ValueHolderECGetter(const T &iValue)
Definition: ECGetterBase.h:61
virtual const T * getImpl() const
Definition: ECGetterBase.h:63
long double T