Skip to content
Snippets Groups Projects
Commit 4e59ad9d authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: make objectRegistry::cfindIOobject public

parent 28800dcb
Branches
Tags
No related merge requests found
...@@ -77,29 +77,6 @@ bool Foam::objectRegistry::parentNotTime() const ...@@ -77,29 +77,6 @@ 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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::objectRegistry::objectRegistry(const Time& t, const label nObjects) Foam::objectRegistry::objectRegistry(const Time& t, const label nObjects)
...@@ -424,6 +401,27 @@ void Foam::objectRegistry::rename(const word& newName) ...@@ -424,6 +401,27 @@ void Foam::objectRegistry::rename(const word& newName)
} }
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;
}
bool Foam::objectRegistry::found bool Foam::objectRegistry::found
( (
const word& name, const word& name,
......
...@@ -138,20 +138,6 @@ class objectRegistry ...@@ -138,20 +138,6 @@ class objectRegistry
void operator=(const objectRegistry&) = delete; 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: public:
//- Declare type name for this IOobject //- Declare type name for this IOobject
...@@ -355,6 +341,16 @@ public: ...@@ -355,6 +341,16 @@ public:
template<class Type> template<class Type>
HashTable<Type*> lookupClass(const bool strict = false); HashTable<Type*> lookupClass(const bool strict = false);
//- 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;
//- Can the regIOobject object be found (by name). //- Can the regIOobject object be found (by name).
// //
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment