37 const word& entryName,
39 const dictionary&
dict,
40 const word& redirectType,
41 const objectRegistry* obrPtr,
45 word modelType(redirectType);
47 const dictionary* coeffs = (eptr ? eptr->dictPtr() :
nullptr);
54 <<
"For " << entryName <<
" with dictionary entries: "
74 <<
"For " << entryName <<
" with primitive entry" <<
nl;
76 ITstream& is = eptr->stream();
78 if (is.peek().isWord())
80 modelType = is.peek().wordToken();
86 const Type constValue = pTraits<Type>(is);
88 return autoPtr<Function1<Type>>
90 new Function1Types::Constant<Type>
103 if (modelType.empty())
110 <<
"Missing or invalid Function1 entry: "
112 <<
exit(FatalIOError);
128 coeffs = &
dict.optionalSubDict(kw +
"Coeffs", keyType::LITERAL);
132 auto* ctorPtr = dictionaryConstructorTable(modelType);
137 <<
"Unknown Function1 type "
138 << modelType <<
" for " << entryName
139 <<
"\n\nValid Function1 types :\n"
140 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
141 <<
exit(FatalIOError);
144 return ctorPtr(entryName, *coeffs, obrPtr);
152 const word& entryName,
154 const word& redirectType,
162 dict.findEntry(entryName, keyType::LITERAL),
175 const word& entryName,
176 std::initializer_list<std::pair<const char*,int>> compat,
178 const word& redirectType,
186 dict.findCompat(entryName, compat, keyType::LITERAL),
213 const word& entryName,
215 const word& redirectType,
230 const word& entryName,
245 fref.
cref(cache.get(entryName));
254 const entry* eptr =
dict.findEntry(entryName, matchOpt);
259 const auto& kw = eptr->
keyword();
262 fref.
cref(cache.get(kw));
283 fref.
cref(fauto.get());
284 cache.set(kw, fauto);
289 if (mandatory && !fref)
292 <<
"No match for " << entryName <<
nl
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static autoPtr< Function1< Type > > NewCompat(const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const word &redirectType=word::null, const objectRegistry *obrPtr=nullptr, const bool mandatory=true)
Compatibility selector, with fallback redirection.
static autoPtr< Function1< Type > > NewIfPresent(const word &entryName, const dictionary &dict, const word &redirectType=word::null, const objectRegistry *obrPtr=nullptr)
An optional selector.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
const keyType & keyword() const noexcept
Return keyword.
option
Enumeration for the data type and search/match modes (bitmask)
Registry of regIOobjects.
A class for managing references or pointers (no reference counting)
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define DebugInFunction
Report an information message using Foam::Info.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)