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
baf3fe8c
Commit
baf3fe8c
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Enabled strict type check on lookupClass
parent
8c5a73eb
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/objectRegistry/objectRegistry.H
+1
-1
1 addition, 1 deletion
src/OpenFOAM/db/objectRegistry/objectRegistry.H
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
+15
-6
15 additions, 6 deletions
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
with
16 additions
and
7 deletions
src/OpenFOAM/db/objectRegistry/objectRegistry.H
+
1
−
1
View file @
baf3fe8c
...
...
@@ -157,7 +157,7 @@ public:
//- Lookup and return all objects of the given Type
template
<
class
Type
>
HashTable
<
const
Type
*>
lookupClass
()
const
;
HashTable
<
const
Type
*>
lookupClass
(
const
bool
strict
=
false
)
const
;
//- Is the named Type found?
template
<
class
Type
>
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
+
15
−
6
View file @
baf3fe8c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2012
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -29,8 +29,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
Foam
::
wordList
Foam
::
objectRegistry
::
names
()
const
Foam
::
wordList
Foam
::
objectRegistry
::
names
()
const
{
wordList
objectNames
(
size
());
...
...
@@ -50,14 +49,24 @@ Foam::objectRegistry::names() const
template
<
class
Type
>
Foam
::
HashTable
<
const
Type
*>
Foam
::
objectRegistry
::
lookupClass
()
const
Foam
::
HashTable
<
const
Type
*>
Foam
::
objectRegistry
::
lookupClass
(
const
bool
strict
)
const
{
HashTable
<
const
Type
*>
objectsOfClass
(
size
());
for
(
const_iterator
iter
=
begin
();
iter
!=
end
();
++
iter
)
{
if
(
isA
<
Type
>
(
*
iter
()))
if
(
strict
&&
isType
<
Type
>
(
*
iter
()))
{
objectsOfClass
.
insert
(
iter
()
->
name
(),
dynamic_cast
<
const
Type
*>
(
iter
())
);
}
else
if
(
isA
<
Type
>
(
*
iter
()))
{
objectsOfClass
.
insert
(
...
...
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