Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
42f49505
Commit
42f49505
authored
Apr 05, 2013
by
andy
Browse files
ENH: Added foundObjectRe function
parent
193feb95
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/objectRegistry/objectRegistry.H
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
;
...
...
src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C
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
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment