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

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

Documentation de fichiers - Reza 12/4/2000

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
[895]18namespace SOPHYA {
19
[219]20typedef void (* DlFunction) (void);
21
[895]22//! Dynamic Link Manager.
[219]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;
[480]43#else
[230]44 void * dlhandle;
[219]45#endif
46 string soName;
47 bool copy;
48};
49
[895]50} // namespace SOPHYA
51
[219]52#endif
Note: See TracBrowser for help on using the repository browser.