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
154 bool allOpened = !libNames.
empty();
158 allOpened = open(libNames[i]) && allOpened;
181 bool allOpened = !libNames.
empty();
185 if (pattern.
match(libNames[i]))
187 allOpened = open(libNames[i], verbose) && allOpened;
204 if (libNames_[i] == libName)
216 <<
"Closing " << libName
217 <<
" with handle " << uintptr_t(libPtrs_[index]) <<
endl;
220 bool ok =
dlClose(libPtrs_[index]);
222 libPtrs_[index] =
nullptr;
230 <<
"could not close " << libName
248 if (libNames_[i] == libName)
257 return libPtrs_[index];
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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.
~dlLibraryTable()
Destructor.
void * findLibrary(const fileName &libName)
Find the handle of the named library.
dlLibraryTable()
Construct null.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
bool openPattern(const regExp &pattern, const bool verbose=true)
Open the named libraries, optionally with warnings if problems occur.
A class for handling file names.
static const fileName null
An empty fileName.
Wrapper around POSIX extended regular expressions.
bool match(const std::string &) const
Return true if it matches the entire string.
A class for handling words, derived from string.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
dlLibraryTable libs
Table of loaded dynamic libraries.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void * dlOpen(const fileName &lib, const bool check=true)
Open a shared library. Return handle to library. Print error message.
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
string getEnv(const word &)
Return environment variable of given name.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
string expand(const string &s, string::size_type &index, const dictionary &dict, const bool allowEnvVars, const bool allowEmpty)