51 open(dict, libsEntry);
66 <<
"Closing " << libNames_[i]
67 <<
" with handle " << uintptr_t(libPtrs_[i]) <<
endl;
72 <<
" with handle " << uintptr_t(libPtrs_[i]) <<
endl;
98 <<
"Opened " << libName
99 <<
" resulting in handle " << uintptr_t(libPtr) <<
endl;
107 <<
"could not load " << libName
115 libPtrs_.append(libPtr);
116 libNames_.append(libName);
133 bool allOpened = !libNames.
empty();
137 allOpened = open(libNames[i], verbose) && allOpened;
147 const word& libsEntry
150 if (dict.
found(libsEntry))
154 bool allOpened = !libNames.
empty();
158 allOpened = open(libNames[i]) && allOpened;
179 if (libNames_[i] == libName)
191 <<
"Closing " << libName
192 <<
" with handle " << uintptr_t(libPtrs_[index]) <<
endl;
195 bool ok =
dlClose(libPtrs_[index]);
197 libPtrs_[index] =
nullptr;
205 <<
"could not close " << libName
223 if (libNames_[i] == libName)
232 return libPtrs_[index];
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static const fileName null
An empty fileName.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dlLibraryTable()
Construct null.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
~dlLibraryTable()
Destructor.
dlLibraryTable libs
Table of loaded dynamic libraries.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
A class for handling words, derived from string.
A table of dynamically loaded libraries.
bool close(const fileName &name, const bool verbose=true)
Close the named library, optionally with warnings if problems occur.
defineTypeNameAndDebug(combustionModel, 0)
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
#define WarningInFunction
Report a warning using Foam::Warning.
void * findLibrary(const fileName &libName)
Find the handle of the named library.
void * dlOpen(const fileName &lib, const bool check=true)
Open a shared library. Return handle to library. Print error message.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
#define InfoInFunction
Report an information message using Foam::Info.