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
f6d462a2
Commit
f6d462a2
authored
Feb 11, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Feb 11, 2019
Browse files
STYLE: make objectRegistry::cfindIOobject() protected instead of public
parent
4e7ac820
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/objectRegistry/objectRegistry.C
View file @
f6d462a2
...
...
@@ -76,6 +76,29 @@ bool Foam::objectRegistry::parentNotTime() const
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
const
Foam
::
regIOobject
*
Foam
::
objectRegistry
::
cfindIOobject
(
const
word
&
name
,
const
bool
recursive
)
const
{
const_iterator
iter
=
cfind
(
name
);
if
(
iter
.
found
())
{
return
iter
.
val
();
}
else
if
(
recursive
&&
this
->
parentNotTime
())
{
return
parent_
.
cfindIOobject
(
name
,
recursive
);
}
return
nullptr
;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
objectRegistry
::
objectRegistry
(
const
Time
&
t
,
const
label
nObjects
)
...
...
@@ -383,57 +406,6 @@ bool Foam::objectRegistry::found
}
const
Foam
::
regIOobject
*
Foam
::
objectRegistry
::
cfindIOobject
(
const
word
&
name
,
const
bool
recursive
)
const
{
const_iterator
iter
=
cfind
(
name
);
if
(
iter
.
found
())
{
return
iter
.
val
();
}
else
if
(
recursive
&&
this
->
parentNotTime
())
{
return
parent_
.
cfindIOobject
(
name
,
recursive
);
}
return
nullptr
;
}
const
Foam
::
regIOobject
*
Foam
::
objectRegistry
::
findIOobject
(
const
word
&
name
,
const
bool
recursive
)
const
{
return
cfindIOobject
(
name
,
recursive
);
}
Foam
::
regIOobject
*
Foam
::
objectRegistry
::
findIOobject
(
const
word
&
name
,
const
bool
recursive
)
{
return
const_cast
<
regIOobject
*>
(
cfindIOobject
(
name
,
recursive
));
}
Foam
::
regIOobject
*
Foam
::
objectRegistry
::
getIOobjectPtr
(
const
word
&
name
,
const
bool
recursive
)
const
{
return
const_cast
<
regIOobject
*>
(
cfindIOobject
(
name
,
recursive
));
}
bool
Foam
::
objectRegistry
::
modified
()
const
{
for
(
const_iterator
iter
=
cbegin
();
iter
!=
cend
();
++
iter
)
...
...
src/OpenFOAM/db/objectRegistry/objectRegistry.H
View file @
f6d462a2
...
...
@@ -137,6 +137,20 @@ class objectRegistry
void
operator
=
(
const
objectRegistry
&
)
=
delete
;
// Protected Member Functions
//- Return const pointer to the regIOobject.
//
// \param recursive search parent registries
//
// \return nullptr if the object was not found.
const
regIOobject
*
cfindIOobject
(
const
word
&
name
,
const
bool
recursive
=
false
)
const
;
public:
//- Declare type name for this IOobject
...
...
@@ -347,52 +361,6 @@ public:
bool
found
(
const
word
&
name
,
const
bool
recursive
=
false
)
const
;
//- Return const pointer to the regIOobject.
//
// \param recursive search parent registries
//
// \return nullptr if the object was not found.
const
regIOobject
*
cfindIOobject
(
const
word
&
name
,
const
bool
recursive
=
false
)
const
;
//- Return const pointer to the regIOobject.
//
// \param recursive search parent registries
//
// \return nullptr if the object was not found.
const
regIOobject
*
findIOobject
(
const
word
&
name
,
const
bool
recursive
=
false
)
const
;
//- Return non-const pointer to the regIOobject.
//
// \param recursive search parent registries
//
// \return nullptr if the object was not found.
regIOobject
*
findIOobject
(
const
word
&
name
,
const
bool
recursive
=
false
);
//- Return non-const pointer to the regIOobject,
//- using a const-cast to have it behave like a mutable.
// Exercise caution when using.
//
// \param recursive search parent registries.
//
// \return nullptr if the object was not found.
regIOobject
*
getIOobjectPtr
(
const
word
&
name
,
const
bool
recursive
=
false
)
const
;
//- Is the named Type found?
//
// \param recursive search parent registries
...
...
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