Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoDynamicLibManager.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : C. OGNIER (Jun 2003)
22**=======================================================================*/
23
24#ifndef _SODYNAMICLIBMANAGER_
25#define _SODYNAMICLIBMANAGER_
26
27#include <Inventor/SbBase.h>
28#include <Inventor/SbString.h>
29
30
43
44public:
57 static SbBool loadLibrary(const SbString& libName, const bool reportError=true);
58
59
63 static SbBool unloadLibrary(const SbString& libName);
64
68 static void unloadAllLibraries();
69
70
74 static SbBool isLibraryLoaded(const SbString& libName);
75
76
82 static void* lookUpFunction(const SbString& libName, const SbString& funcName, const bool reportError=true);
83
84
90 static int getLoadedLibraryList(SbString*& libList);
91
92
98
99
105 static SbString getLibraryFromSymbol(void* symbol);
106
107private:
112 static bool isLoaded(const SbString&);
113
119 static void* libLookUpFunction(const SbHandle libHandle, const SbString& funcName);
120
121 static void exit();
122
123 struct SafeLibraryHandle
124 {
125 private:
126 SbString m_libName;
127 bool m_hasDispose;
128
129 public:
130 SafeLibraryHandle();
131 SafeLibraryHandle(const SbString &libName);
132 ~SafeLibraryHandle();
133
134 SbHandle getHandle() const;
135 void release();
136 };
137
138 static SbHandle getLibraryHandle(const SbString& libName);
139
140private:
141 static SbString extractLibName(const SbString& s);
142
143
144 static void* m_libMap;
145};
146
147#endif
148
149
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class for managi...
static SbBool unloadLibrary(const SbString &libName)
Unloads a dynamic library previously loaded by the above method.
static SbString getLibraryFromSymbol(void *symbol)
Returns the full path of the library that contains the given symbol.
static SbString getLibrarySuffix()
Returns the dynamic library suffix used on the current operating system.
static void unloadAllLibraries()
Unloads all dynamic libraries previously loaded by the class.
static SbBool loadLibrary(const SbString &libName, const bool reportError=true)
Loads a dynamic library using the specified libName.
static void * lookUpFunction(const SbString &libName, const SbString &funcName, const bool reportError=true)
Inquires if the specified function is available in the specified library.
static SbBool isLibraryLoaded(const SbString &libName)
Inquires if the given library is already loaded by this class.
static int getLoadedLibraryList(SbString *&libList)
Allocates an array and fills it with the names of the libraries loaded by this class.
int SbBool
Boolean type.
Definition SbBase.h:87