source: Sophya/trunk/SophyaLib/SysTools/pdlmgr.h@ 656

Last change on this file since 656 was 480, checked in by ansari, 26 years ago

MAJ / PEIDA 3.8 , Reza 20/10/99

File size: 1.1 KB
RevLine 
[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
11
12#if defined(HPUX)
13#include <dl.h>
[230]14#else
15#include <dlfcn.h>
[219]16#endif
17
18typedef void (* DlFunction) (void);
19
20class PDynLinkMgr {
21public:
22 // ---- Methodes globales (static)
23 static PDynLinkMgr* BuildFromCFile(string const & fname); // Compil+link fichier C
24 static void SetTmpDir(string const & path); // Repertoire des fichiers temporaires
25
26 // ---- Constructeur et methodes
27 // Constructeur a partir d'un shared lib - copie en zone temporaire si cp==true
28 PDynLinkMgr(string& soname, bool cp=true);
29 virtual ~PDynLinkMgr();
30
31 virtual DlFunction GetFunction(string const & funcname);
32
33protected :
34 static string& GetTmpDir();
35 static int numSO;
36 static string* tmpDir;
37
38#if defined(HPUX)
39 shl_t dlhandle;
[480]40#else
[230]41 void * dlhandle;
[219]42#endif
43 string soName;
44 bool copy;
45};
46
47#endif
Note: See TracBrowser for help on using the repository browser.