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

PseudoNew1P Class Template Reference

#include <PseudoNew1P.h>

Collaboration diagram for PseudoNew1P:

Collaboration graph
[legend]
List of all members.

Public Methods

 PseudoNew1P (void *libFunPtr)
 Constructor. It takes a void funtion pointer as returned e.g. by dlsym(). More...

 PseudoNew1P (void)
 Default constructor. More...

virtual ~PseudoNew1P ()
void bind (void *libFunPtr)
T1 * create (T2 par)
bool isValid ()
 Did we really find the pseudo constructor function in the library? More...


Protected Attributes

T1 *(* newMethodPtr )(T2)

Detailed Description

template<class T1, class T2>
class PseudoNew1P< T1, T2 >

Class to hold a pseudo-new function implemented in a shared library. This is a variation of the PseudoNew class which deals with constructors having one parameter of arbitrary type. Each shared library should implement a function with C linkage that works as some kind of factory method. To get a new instance of the class implemented in the shared library the user code makes a call to such function. E.g.:
  // declaration
  extern "C" {
    aTest *makeNew(char *name);
  }

  // implementation
  aTest *makeNew(name) { return new shTest(name);  }

  

Definition at line 28 of file PseudoNew1P.h.


Constructor & Destructor Documentation

PseudoNew1P void *    libFunPtr [inline]
 

Definition at line 31 of file PseudoNew1P.h.

References newMethodPtr.

PseudoNew1P void    [inline]
 

Definition at line 35 of file PseudoNew1P.h.

References newMethodPtr.

virtual ~PseudoNew1P   [inline, virtual]
 

Definition at line 38 of file PseudoNew1P.h.


Member Function Documentation

void bind void *    libFunPtr [inline]
 

Binding method (used to initialize an instance created with the default constructor. It takes a void function pointer as returned e.g. by dlsym().

Definition at line 42 of file PseudoNew1P.h.

References newMethodPtr.

T1* create T2    par [inline]
 

Create a new instance of the class by calling the pseudo contructor. The object will (very likely) be created in dynamic memory, thus the user is responsible for deletion.

Definition at line 49 of file PseudoNew1P.h.

bool isValid   [inline]
 

Definition at line 53 of file PseudoNew1P.h.

References newMethodPtr.


Member Data Documentation

T1*(* newMethodPtr)(T2) [protected]
 

Referenced by bind, isValid, and PseudoNew1P.


The documentation for this class was generated from the following file:
Generated on Tue May 20 14:50:28 2003 for HepUtilities by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002