ENH: add dictionary::findStream() - symmetric with findDict()

- can be used with this type of code:

  ITstream* streamPtr = dict.findStream(name);
  if (streamPtr)
  {
      auto& is = *streamPtr;
      ...
  }

  versus:

  const entry* eptr = dict.findEntry(name);
  if (eptr && eptr->isStream())
  {
      auto& is = eptr->stream();
      ...
  }

ENH: add findStream(), streamPtr(), isStream() to dictionary search

- symmetric with findDict(), dictPtr(), isDict() methods

STYLE: use findDict() instead of found() + subDict() pairing

COMP: define is_globalIOobject trait at top of IOobject header

- more visibility, permits reuse for specializations etc.
This commit is contained in:
Mark Olesen
2024-05-13 14:31:32 +02:00
parent 6a80d4de40
commit 3b9176665f
15 changed files with 116 additions and 100 deletions

View File

@ -549,16 +549,17 @@ int main(int argc, char *argv[])
{
Info<< finder.dict();
}
else if (finder.ref().isStream())
else if (finder.isStream())
{
bool addSep = false;
bool separator = false;
const tokenList& tokens = finder.ref().stream();
for (const token& tok : tokens)
for (const token& tok : finder.stream())
{
if (addSep) Info<< token::SPACE;
addSep = true;
if (separator)
{
Info<< token::SPACE;
}
separator = true;
Info<< tok;
}
Info<< endl;