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

Last change on this file since 2483 was 1900, checked in by ansari, 24 years ago

Portage sous Mac OS X - Reza 15/02/2002

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