ENH: simplify objectRegistry access names (issue #322)

New name:  findObject(), cfindObject()
  Old name:  lookupObjectPtr()

      Return a const pointer or nullptr on failure.

  New name:  findObject()
  Old name:  --

      Return a non-const pointer or nullptr on failure.

  New name:  getObjectPtr()
  Old name:  lookupObjectRefPtr()

      Return a non-const pointer or nullptr on failure.
      Can be called on a const object and it will perform a
      const_cast.

- use these updated names and functionality in more places

NB: The older methods names are deprecated, but continue to be defined.
This commit is contained in:
Mark Olesen
2018-10-17 16:44:10 +02:00
parent e0255cfff2
commit 8fabc32539
94 changed files with 918 additions and 952 deletions

View File

@ -176,16 +176,15 @@ bool Foam::functionObjects::zeroGradient::write()
}
// Consistent output order
const wordList outputList = results_.sortedToc();
for (const word& fieldName : outputList)
for (const word& fieldName : results_.sortedToc())
{
if (foundObject<regIOobject>(fieldName))
{
const regIOobject& io = lookupObject<regIOobject>(fieldName);
const regIOobject* ioptr = findObject<regIOobject>(fieldName);
if (ioptr)
{
Log << " " << fieldName << endl;
io.write();
ioptr->write();
}
}