50 open(dict, libsEntry);
65 <<
"Closing " << libNames_[i]
66 <<
" with handle " << uintptr_t(libPtrs_[i]) <<
endl;
71 <<
" with handle " << uintptr_t(libPtrs_[i]) <<
endl;
86 if (functionLibName.size())
88 void* functionLibPtr =
dlOpen 97 <<
"Opened " << functionLibName
98 <<
" resulting in handle " << uintptr_t(functionLibPtr) <<
endl;
106 <<
"could not load " << functionLibName
114 libPtrs_.append(functionLibPtr);
115 libNames_.append(functionLibName);
135 if (libNames_[i] == functionLibName)
147 <<
"Closing " << functionLibName
148 <<
" with handle " << uintptr_t(libPtrs_[index]) <<
endl;
151 bool ok =
dlClose(libPtrs_[index]);
153 libPtrs_[index] =
nullptr;
161 <<
"could not close " << functionLibName
179 if (libNames_[i] == functionLibName)
188 return libPtrs_[index];
197 const word& libsEntry
200 if (dict.
found(libsEntry))
204 bool allOpened = !libNames.
empty();
bool open(const fileName &name, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
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...
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.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void * findLibrary(const fileName &name)
Find the handle of the named library.
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
A class for handling words, derived from string.
bool close(const fileName &name, const bool verbose=true)
Close the named library, optionally with warnings if problems occur.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
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.