50 open(dict, libsEntry);
65 <<
"Closing " << libNames_[i]
66 <<
" with handle " << uintptr_t(libPtrs_[i]) <<
endl;
82 if (functionLibName.size())
84 void* functionLibPtr =
dlOpen(functionLibName, verbose);
89 <<
"Opened " << functionLibName
90 <<
" resulting in handle " << uintptr_t(functionLibPtr) <<
endl;
98 <<
"could not load " << functionLibName
106 libPtrs_.append(functionLibPtr);
107 libNames_.append(functionLibName);
127 if (libNames_[i] == functionLibName)
139 <<
"Closing " << functionLibName
140 <<
" with handle " << uintptr_t(libPtrs_[index]) <<
endl;
143 bool ok =
dlClose(libPtrs_[index]);
145 libPtrs_[index] = NULL;
153 <<
"could not close " << functionLibName
171 if (libNames_[i] == functionLibName)
180 return libPtrs_[index];
189 const word& libsEntry
192 if (dict.
found(libsEntry))
196 bool allOpened = !libNames.
empty();
bool open(const fileName &name, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
#define forAll(list, i)
Loop across all elements in list.
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...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
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.
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 found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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.