mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add IOobjectList::findObject() method
- naming similar to objectRegistry, with unambiguous resolution.
The lookup() methods have different return types depending on the
calling parameter.
STYLE: use IOobjectListTemplates.C for implementations
- previously included as local definition within IOobjectList.C,
but will be adding more templated methods soon.
- adjust parameters (eg, matchName instead of matcher) to show their
function
ENH: handle objectRegistry::names<void>(...)
- this is equivalent to no Type restriction, and can be used when
filtering names. Eg,
obr.names<void>(wordRe..);
This commit is contained in:
@ -49,10 +49,31 @@ void reportDetail(const IOobjectList& objects)
|
||||
|
||||
for (const word& key : objects.sortedNames())
|
||||
{
|
||||
IOobject* io = objects.lookup(key);
|
||||
// Canonical method name (NOV-2018)
|
||||
IOobject* io = objects.findObject(key);
|
||||
|
||||
label count = 0;
|
||||
|
||||
// Test deprecated alternatives
|
||||
{
|
||||
// (const char*)
|
||||
IOobject* ptr = objects.lookup("SomeNonExistentName");
|
||||
if (ptr) ++count;
|
||||
}
|
||||
{
|
||||
// (const word&)
|
||||
IOobject* ptr = objects.lookup(key);
|
||||
if (ptr) ++count;
|
||||
}
|
||||
|
||||
Info<< key << " (" << io->headerClassName()
|
||||
<< ") = addr " << long(io) << nl;
|
||||
|
||||
if (count != 1)
|
||||
{
|
||||
Warning
|
||||
<< key << " had incorrect lookup?" << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<<"====" << nl;
|
||||
|
||||
Reference in New Issue
Block a user