mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: make objectRegistry::cfindIOobject public
This commit is contained in:
@ -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)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
|||||||
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:
|
|||||||
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).
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user