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
42f49505
Commit
42f49505
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Added foundObjectRe function
parent
193feb95
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/objectRegistry/objectRegistry.H
+4
-0
4 additions, 0 deletions
src/OpenFOAM/db/objectRegistry/objectRegistry.H
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
+25
-0
25 additions, 0 deletions
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
with
29 additions
and
0 deletions
src/OpenFOAM/db/objectRegistry/objectRegistry.H
+
4
−
0
View file @
42f49505
...
...
@@ -163,6 +163,10 @@ public:
template
<
class
Type
>
HashTable
<
Type
*>
lookupClass
(
const
bool
strict
=
false
);
//- Return the list of objects whose name matches the input regExp
template
<
class
Type
>
wordList
foundObjectRe
(
const
wordRe
&
name
)
const
;
//- Is the named Type found?
template
<
class
Type
>
bool
foundObject
(
const
word
&
name
)
const
;
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
+
25
−
0
View file @
42f49505
...
...
@@ -127,6 +127,31 @@ bool Foam::objectRegistry::foundObject(const word& name) const
}
template
<
class
Type
>
Foam
::
wordList
Foam
::
objectRegistry
::
foundObjectRe
(
const
wordRe
&
name
)
const
{
wordList
objectNames
(
size
());
label
count
=
0
;
forAllConstIter
(
HashTable
<
regIOobject
*>
,
*
this
,
iter
)
{
if
(
isA
<
Type
>
(
*
iter
()))
{
const
word
&
objectName
=
iter
()
->
name
();
if
(
name
.
match
(
objectName
))
{
objectNames
[
count
++
]
=
objectName
;
}
}
}
objectNames
.
setSize
(
count
);
return
objectNames
;
}
template
<
class
Type
>
const
Type
&
Foam
::
objectRegistry
::
lookupObject
(
const
word
&
name
)
const
{
...
...
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