43#ifndef Foam_dlLibraryTable_H
44#define Foam_dlLibraryTable_H
70 static std::unique_ptr<dlLibraryTable> global_;
86 static bool functionHook
90 const std::string& funcName,
92 const std::string& context
98 void* openLibrary(
const fileName& libName,
bool verbose);
154 std::initializer_list<fileName> libNames,
172 const word& libsEntry,
200 const std::string& funcName,
201 const bool verbose =
false,
202 const std::string& context =
""
212 const std::string& funcName,
213 const bool verbose =
false,
214 const std::string& context =
""
251 label
push_back(
const UList<fileName>& libNames);
256 bool open(
bool verbose =
true);
261 void*
open(
const fileName& libName,
bool verbose =
true);
265 bool open(
const UList<fileName>& libNames,
bool verbose =
true);
271 std::initializer_list<fileName> libNames,
277 void close(
bool verbose =
true);
281 bool close(
const fileName& libName,
bool verbose =
true);
290 const word& libsEntry,
302 template<
class TablePtr>
306 const word& libsEntry,
307 const TablePtr& tablePtr,
330 label
append(
const UList<fileName>& libNames)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A helper class for outputting values to Ostream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A table of dynamically loaded libraries.
const UList< fileName > & names() const noexcept
Names of the libraries in use, or requested.
bool push_back(const fileName &libName)
Add to the list of names, but do not yet open.
bool open(bool verbose=true)
Open named, but unopened libraries. These names will normally have been added with push_back().
void operator=(const dlLibraryTable &)=delete
No copy assignment.
static bool unloadHook(void *handle, const std::string &funcName, const bool verbose=false, const std::string &context="")
Low-level interface to execute global "void funcName(false)" from the library, typically for unloadin...
bool empty() const noexcept
True if there are no libraries loaded by the table.
static dlLibraryTable & libs()
Table of global libraries.
void(* loaderType)(bool)
Global loader/unloader function type (C-linkage).
List< fileName > loaded() const
Names of the libraries in use.
~dlLibraryTable()
Destructor. Closes all libraries loaded by the table.
label size() const noexcept
The number of libraries loaded by the table.
bool append(const fileName &libName)
Add to the list of names, but do not yet open.
static bool loadHook(void *handle, const std::string &funcName, const bool verbose=false, const std::string &context="")
Low-level interface to execute global "void funcName(true)" from the library, typically for additiona...
const UList< void * > & pointers() const noexcept
Pointers to the libraries in use. Access with caution.
void * findLibrary(const fileName &libName)
Find the handle of the named library.
label append(const UList< fileName > &libNames)
Add to the list of names, but do not yet open.
ClassName("dlLibraryTable")
Declare name of the class and its debug switch.
dlLibraryTable(dlLibraryTable &&)=default
Move construct.
static word fullname(word libName)
Library fullname, prefix with 'lib', suffix with '.so'.
void clear()
Clears the table, without attempting to close the libraries.
static word basename(const fileName &libPath)
Library basename without leading 'lib' or trailing '.so'.
dlLibraryTable(const dlLibraryTable &)=delete
No copy construct.
dlLibraryTable & operator=(dlLibraryTable &&)=default
Move assignment.
InfoProxy< dlLibraryTable > info() const noexcept
Return info proxy, used to print library table information to a stream.
static int dlcloseOnTerminate
Use dlclose() when clearing the dlLibraryTable.
dlLibraryTable()=default
Default construct.
void close(bool verbose=true)
Close all libraries loaded by the table and remove the closed functions from the table.
A class for handling file names.
A class for handling words, derived from Foam::string.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).