Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
ea2fcaa0
Commit
ea2fcaa0
authored
14 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add verbose option for dlLibraryTable::open/close
- allows silent operation when we know what we are doing.
parent
f0f2bfa6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.C
+27
-13
27 additions, 13 deletions
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.C
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.H
+5
-5
5 additions, 5 deletions
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.H
with
32 additions
and
18 deletions
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.C
+
27
−
13
View file @
ea2fcaa0
...
@@ -62,7 +62,11 @@ Foam::dlLibraryTable::~dlLibraryTable()
...
@@ -62,7 +62,11 @@ Foam::dlLibraryTable::~dlLibraryTable()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
dlLibraryTable
::
open
(
const
fileName
&
functionLibName
)
bool
Foam
::
dlLibraryTable
::
open
(
const
fileName
&
functionLibName
,
const
bool
verbose
)
{
{
if
(
functionLibName
.
size
())
if
(
functionLibName
.
size
())
{
{
...
@@ -70,11 +74,14 @@ bool Foam::dlLibraryTable::open(const fileName& functionLibName)
...
@@ -70,11 +74,14 @@ bool Foam::dlLibraryTable::open(const fileName& functionLibName)
if
(
!
functionLibPtr
)
if
(
!
functionLibPtr
)
{
{
WarningIn
if
(
verbose
)
(
{
"dlLibraryTable::open(const fileName& functionLibName)"
WarningIn
)
<<
"could not load "
<<
functionLibName
(
<<
endl
;
"dlLibraryTable::open(const fileName&)"
)
<<
"could not load "
<<
functionLibName
<<
endl
;
}
return
false
;
return
false
;
}
}
...
@@ -97,7 +104,11 @@ bool Foam::dlLibraryTable::open(const fileName& functionLibName)
...
@@ -97,7 +104,11 @@ bool Foam::dlLibraryTable::open(const fileName& functionLibName)
}
}
bool
Foam
::
dlLibraryTable
::
close
(
const
fileName
&
functionLibName
)
bool
Foam
::
dlLibraryTable
::
close
(
const
fileName
&
functionLibName
,
const
bool
verbose
)
{
{
void
*
libPtr
=
findLibrary
(
functionLibName
);
void
*
libPtr
=
findLibrary
(
functionLibName
);
if
(
libPtr
)
if
(
libPtr
)
...
@@ -106,11 +117,14 @@ bool Foam::dlLibraryTable::close(const fileName& functionLibName)
...
@@ -106,11 +117,14 @@ bool Foam::dlLibraryTable::close(const fileName& functionLibName)
if
(
!
dlClose
(
libPtr
))
if
(
!
dlClose
(
libPtr
))
{
{
WarningIn
if
(
verbose
)
(
{
"dlLibraryTable::close(const fileName& functionLibName)"
WarningIn
)
<<
"could not close "
<<
functionLibName
(
<<
endl
;
"dlLibraryTable::close(const fileName&)"
)
<<
"could not close "
<<
functionLibName
<<
endl
;
}
return
false
;
return
false
;
}
}
...
@@ -144,7 +158,7 @@ bool Foam::dlLibraryTable::open
...
@@ -144,7 +158,7 @@ bool Foam::dlLibraryTable::open
{
{
fileNameList
libNames
(
dict
.
lookup
(
libsEntry
));
fileNameList
libNames
(
dict
.
lookup
(
libsEntry
));
bool
allOpened
=
(
libNames
.
size
()
>
0
);
bool
allOpened
=
!
libNames
.
empty
(
);
forAll
(
libNames
,
i
)
forAll
(
libNames
,
i
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/dlLibraryTable/dlLibraryTable.H
+
5
−
5
View file @
ea2fcaa0
...
@@ -94,11 +94,11 @@ public:
...
@@ -94,11 +94,11 @@ public:
// Member Functions
// Member Functions
//- Open the named library
//- Open the named library
, optionally with warnings if problems occur
static
bool
open
(
const
fileName
&
name
);
static
bool
open
(
const
fileName
&
name
,
const
bool
verbose
=
true
);
//- Close the named library
//- Close the named library
, optionally with warnings if problems occur
static
bool
close
(
const
fileName
&
name
);
static
bool
close
(
const
fileName
&
name
,
const
bool
verbose
=
true
);
//- Find the handle of the named library
//- Find the handle of the named library
static
void
*
findLibrary
(
const
fileName
&
name
);
static
void
*
findLibrary
(
const
fileName
&
name
);
...
@@ -109,7 +109,7 @@ public:
...
@@ -109,7 +109,7 @@ public:
//- Open all the libraries listed in the 'libsEntry' entry in the
//- Open all the libraries listed in the 'libsEntry' entry in the
// given dictionary if present and check the additions
// given dictionary if present and check the additions
// to the give constructor table
// to the give
n
constructor table
template
<
class
TablePtr
>
template
<
class
TablePtr
>
static
bool
open
static
bool
open
(
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment