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

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

ppersist + pexc

File size: 1.1 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 "machdefs.h"
9#include <string>
10#if defined(__KCC__)
11using std::string ;
12#endif
13
14
15#if defined(HPUX)
16#include <dl.h>
17#else
18#include <dlfcn.h>
19#endif
20
21typedef void (* DlFunction) (void);
22
23class PDynLinkMgr {
24public:
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
36protected :
37 static string& GetTmpDir();
38 static int numSO;
39 static string* tmpDir;
40
41#if defined(HPUX)
42 shl_t dlhandle;
43#else
44 void * dlhandle;
45#endif
46 string soName;
47 bool copy;
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.