Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

PseudoNew.h

Go to the documentation of this file.
00001 // 
00002 // Copyright (C) CERN, Geneva 
00003 // 
00004 
00005 #ifndef _PSEUDONEW_H
00006 #define _PSEUDONEW_H
00007 
00044 template <class T > class PseudoNew {
00045 public:
00047   PseudoNew (void *libFunPtr) {
00048     newMethodPtr = (T *(*)()) libFunPtr;
00049   }
00051   PseudoNew (void) {
00052     newMethodPtr = (T *(*)()) 0;
00053   }    
00054   virtual ~PseudoNew() {};
00058   void bind (void *libFunPtr) {
00059     newMethodPtr = (T *(*)()) libFunPtr;
00060   }
00065   virtual T* create() {
00066     return (*newMethodPtr)();
00067   }
00069   bool isValid () { return newMethodPtr != 0;}
00070 protected:
00071   T* (*newMethodPtr) ();
00072 };
00073 
00074 
00075 #endif // _PSEUDONEW_H

Generated on Tue May 20 14:50:25 2003 for HepUtilities by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002