Rev | Line | |
---|
[219] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Gestionnaire de lien dynamique - R. Ansari 12/98
|
---|
| 3 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
| 4 |
|
---|
| 5 | #ifndef PDYNLINKMGR_SEEN
|
---|
| 6 | #define PDYNLINKMGR_SEEN
|
---|
| 7 |
|
---|
[241] | 8 | #include "machdefs.h"
|
---|
[219] | 9 | #include <string>
|
---|
| 10 | #if defined(__KCC__)
|
---|
| 11 | using std::string ;
|
---|
| 12 | #endif
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | #if defined(HPUX)
|
---|
| 16 | #include <dl.h>
|
---|
[230] | 17 | #else
|
---|
| 18 | #include <dlfcn.h>
|
---|
[219] | 19 | #endif
|
---|
| 20 |
|
---|
| 21 | typedef void (* DlFunction) (void);
|
---|
| 22 |
|
---|
| 23 | class PDynLinkMgr {
|
---|
| 24 | public:
|
---|
| 25 | // ---- Methodes globales (static)
|
---|
| 26 | static PDynLinkMgr* BuildFromCFile(string const & fname); // Compil+link fichier C
|
---|
| 27 | static void SetTmpDir(string const & path); // Repertoire des fichiers temporaires
|
---|
| 28 |
|
---|
| 29 | // ---- Constructeur et methodes
|
---|
| 30 | // Constructeur a partir d'un shared lib - copie en zone temporaire si cp==true
|
---|
| 31 | PDynLinkMgr(string& soname, bool cp=true);
|
---|
| 32 | virtual ~PDynLinkMgr();
|
---|
| 33 |
|
---|
| 34 | virtual DlFunction GetFunction(string const & funcname);
|
---|
| 35 |
|
---|
| 36 | protected :
|
---|
| 37 | static string& GetTmpDir();
|
---|
| 38 | static int numSO;
|
---|
| 39 | static string* tmpDir;
|
---|
| 40 |
|
---|
| 41 | #if defined(HPUX)
|
---|
| 42 | shl_t dlhandle;
|
---|
[230] | 43 | #else
|
---|
| 44 | void * dlhandle;
|
---|
[219] | 45 | #endif
|
---|
| 46 | string soName;
|
---|
| 47 | bool copy;
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.