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

Last change on this file since 1277 was 895, checked in by ansari, 25 years ago

Documentation de fichiers - Reza 12/4/2000

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
11
12#if defined(HPUX)
13#include <dl.h>
14#else
15#include <dlfcn.h>
16#endif
17
18namespace SOPHYA {
19
20typedef void (* DlFunction) (void);
21
22//! Dynamic Link Manager.
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} // namespace SOPHYA
51
52#endif
Note: See TracBrowser for help on using the repository browser.