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

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

Creation module DPC/SysTools Reza 09/04/99

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