Go to the documentation of this file.
43 #ifndef dlLibraryTable_H
44 #define dlLibraryTable_H
58 Ostream&
operator<<(Ostream&
os,
const InfoProxy<dlLibraryTable>& info);
69 static std::unique_ptr<dlLibraryTable> global_;
85 static bool functionHook
89 const std::string& funcName,
91 const std::string& context
97 void* openLibrary(
const fileName& libName,
bool verbose);
153 std::initializer_list<fileName> libNames,
161 const word& libsEntry,
171 const word& libsEntry,
199 const std::string& funcName,
200 const bool verbose =
false,
201 const std::string& context =
""
211 const std::string& funcName,
212 const bool verbose =
false,
213 const std::string& context =
""
253 bool open(
bool verbose =
true);
258 void*
open(
const fileName& libName,
bool verbose =
true);
268 std::initializer_list<fileName> libNames,
274 void close(
bool verbose =
true);
287 const word& libsEntry,
299 template<
class TablePtr>
303 const word& libsEntry,
304 const TablePtr& tablePtr,
List< fileName > loaded() const
Names of the libraries in use.
const UList< void * > & pointers() const
Pointers to the libraries in use. Access with caution.
A table of dynamically loaded libraries.
void * findLibrary(const fileName &libName)
Find the handle of the named library.
A class for handling words, derived from Foam::string.
A helper class for outputting values to Ostream.
A class for handling file names.
void close(bool verbose=true)
static word basename(const fileName &libPath)
Library basename without leading 'lib' or trailing '.so'.
bool empty() const
True if there are no libraries loaded by the table.
InfoProxy< dlLibraryTable > info() const
Return info proxy.
static bool unloadHook(void *handle, const std::string &funcName, const bool verbose=false, const std::string &context="")
void operator=(const dlLibraryTable &)=delete
No copy assignment.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
bool append(const fileName &libName)
Add to the list of names, but do not yet open.
const UList< fileName > & names() const
Names of the libraries in use, or requested.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
bool open(bool verbose=true)
static int dlcloseOnTerminate
Use dlclose() when clearing the dlLibraryTable.
static dlLibraryTable & libs()
Table of global libraries.
ClassName("dlLibraryTable")
Declare name of the class and its debug switch.
static word fullname(word libName)
Library fullname, prefix with 'lib', suffix with '.so'.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static bool loadHook(void *handle, const std::string &funcName, const bool verbose=false, const std::string &context="")
label size() const
The number of libraries loaded by the table.
void clear()
Clears the table, without attempting to close the libraries.
void(* loaderType)(bool)
Global loader/unloader function type (C-linkage)
dlLibraryTable()=default
Default construct.
~dlLibraryTable()
Destructor. Closes all libraries loaded by the table.