A keyword and a list of tokens is an 'entry'. More...
Public Types | |
enum | inputMode { MERGE, OVERWRITE, PROTECT, WARN, ERROR, GLOBAL } |
Public Member Functions | |
entry (const keyType &keyword) | |
entry (const entry &e) | |
virtual autoPtr< entry > | clone (const dictionary &parentDict) const =0 |
virtual autoPtr< entry > | clone () const |
virtual | ~entry ()=default |
const keyType & | keyword () const noexcept |
keyType & | keyword () noexcept |
virtual const fileName & | name () const =0 |
virtual fileName & | name ()=0 |
virtual fileName | relativeName () const =0 |
virtual label | startLineNumber () const =0 |
virtual label | endLineNumber () const =0 |
virtual bool | isStream () const noexcept |
virtual ITstream & | stream () const =0 |
virtual bool | isDict () const noexcept |
virtual const dictionary * | dictPtr () const noexcept |
virtual dictionary * | dictPtr () noexcept |
virtual const dictionary & | dict () const =0 |
virtual dictionary & | dict ()=0 |
void | checkITstream (const ITstream &is) const |
template<class T > | |
T | get () const |
template<class T > | |
void | readEntry (T &val) const |
template<class T , class Predicate > | |
T | getCheck (const Predicate &pred) const |
template<class T , class Predicate > | |
void | readCheck (T &val, const Predicate &pred) const |
virtual void | write (Ostream &os) const =0 |
void | operator= (const entry &e) |
bool | operator== (const entry &e) const |
bool | operator!= (const entry &e) const |
Static Public Member Functions | |
static bool | New (dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0) |
static autoPtr< entry > | New (Istream &is) |
static void | resetInputMode () |
Static Public Attributes | |
static int | disableFunctionEntries |
static inputMode | globalInputMode = inputMode::MERGE |
Static Protected Member Functions | |
static void | reportReadWarning (const IOstream &, const std::string &) |
Friends | |
Ostream & | operator<< (Ostream &os, const entry &e) |
A keyword and a list of tokens is an 'entry'.
An entry can be read, written and printed, and the types and values of its tokens analysed. An entry is a high-level building block for data description. It is a front-end for the token parser. A list of entries can be used as a set of keyword syntax elements, for example.
|
strong |
Enumerator | |
---|---|
MERGE | Merge sub-dictionaries when possible. |
OVERWRITE | Keep last entry. Silently remove previous ones. |
PROTECT | Keep initial entry. Silently ignore subsequent ones. |
WARN | Keep initial entry. Warn about subsequent ones. |
ERROR | FatalError for duplicate entries. |
GLOBAL | Use global value from globalInputMode variable. |
|
virtualdefault |
|
staticprotected |
Definition at line 41 of file entry.C.
References Foam::endl(), IOstream::lineNumber(), and IOstream::relativeName().
|
pure virtual |
Implemented in dictionaryEntry, dictionaryListEntry, and primitiveEntry.
|
virtual |
Definition at line 76 of file entry.C.
References dictionary::null.
|
static |
Definition at line 98 of file entryIO.C.
References dictionary::add(), token::BEGIN_BLOCK, token::BEGIN_LIST, fileName::clean(), dictionary::csearchScoped(), entry::disableFunctionEntries, token::DOLLAR, token::END_BLOCK, token::END_LIST, IOstream::eof(), functionEntry::execute(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, token::HASH, token::info(), Foam::stringOps::inplaceExpand(), token::isLabel(), token::isPunctuation(), Foam::glTF::key(), keyType::LITERAL, dictionary::makeScopedDict(), Foam::mode(), fileName::name(), fileName::path(), Istream::putBack(), keyType::REGEX, keyType::REGEX_RECURSIVE, dictionary::search(), dictionary::searchScoped(), dictionary::substituteScopedKeyword(), and word::validate().
Referenced by ifeqEntry::evaluate(), dictionary::read(), and functionObjectList::readFunctionObject().
|
static |
Definition at line 456 of file entryIO.C.
References token::BEGIN_BLOCK, IOstream::fatalCheck(), FUNCTION_NAME, dictionary::null, Istream::putBack(), and autoPtr::reset().
|
static |
Definition at line 54 of file entry.C.
References entry::globalInputMode, and entry::MERGE.
Referenced by dictionary::dictionary(), and Foam::operator>>().
|
inlinenoexcept |
Definition at line 191 of file entry.H.
Referenced by dictionary::add(), cellModel::cellModel(), solutionControl::maxResidual(), solutionControl::maxTypeResidual(), phase::iNew::operator()(), phaseModel::iNew::operator()(), sizeGroup::iNew::operator()(), Foam::operator>>(), Foam::functionObjects::operator>>(), genericPatchFieldBase::processEntry(), GeometricField::Boundary::readField(), refinementSurfaces::refinementSurfaces(), dictionary::set(), shellSurfaces::shellSurfaces(), Foam::blockMeshTools::write(), dictionaryListEntry::write(), dictionaryEntry::write(), and genericPatchFieldBase::writeGeneric().
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by dictionary::add().
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by dynamicCodeContext::readEntry().
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
|
inlinevirtualnoexcept |
Reimplemented in primitiveEntry.
Definition at line 219 of file entry.H.
Referenced by Constant< Type >::Constant(), Polynomial< Type >::Polynomial(), genericPatchFieldBase::processEntry(), and Table< Type >::Table().
|
pure virtual |
Implemented in primitiveEntry, and dictionaryEntry.
Referenced by Constant< Type >::Constant(), exprResultDelayed::exprResultDelayed(), Foam::exprTools::getList(), expressionEntry::inplaceExpand(), solutionControl::maxTypeResidual(), fvGeometryScheme::New(), Polynomial< Type >::Polynomial(), genericPatchFieldBase::processEntry(), Foam::blockMeshTools::read(), entry::readCheck(), fvExprDriver::readDict(), entry::readEntry(), Foam::readScaling(), shellSurfaces::shellSurfaces(), Table< Type >::Table(), solution::upgradeSolverDict(), and Foam::writeEntryIfPresent().
|
inlinevirtualnoexcept |
Definition at line 229 of file entry.H.
References entry::dictPtr().
Referenced by dictionary::add(), dictionary::cfindScopedDict(), Foam::entryToString(), GAMGSolver::GAMGSolver(), Foam::getVariableOrDie(), dictionary::makeScopedDict(), functionObjectList::read(), GeometricField::Boundary::readField(), Foam::debug::switchSet(), solution::upgradeSolverDict(), and Foam::writeEntryIfPresent().
|
inlinevirtualnoexcept |
Reimplemented in dictionaryEntry.
Definition at line 236 of file entry.H.
Referenced by dictionary::cfindScopedDict(), entry::isDict(), and dictionary::makeScopedDict().
|
inlinevirtualnoexcept |
Reimplemented in dictionaryEntry.
|
pure virtual |
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by dictionary::add(), Foam::entryToString(), GAMGSolver::GAMGSolver(), functionObjectList::read(), sampledSurfaces::read(), GeometricField::Boundary::readField(), refinementSurfaces::refinementSurfaces(), shellSurfaces::shellSurfaces(), Foam::debug::switchSet(), and Foam::writeEntryIfPresent().
|
pure virtual |
Implemented in dictionaryEntry, and primitiveEntry.
void checkITstream | ( | const ITstream & | is | ) | const |
Definition at line 103 of file entry.C.
References JobInfo::constructed, Foam::endl(), Foam::exit(), Foam::FatalIOError, IOstream::lineNumber(), Foam::nl, and ITstream::nRemainingTokens().
Referenced by entry::readCheck(), entry::readEntry(), and Foam::readScaling().
|
inline |
Definition at line 265 of file entry.H.
References Foam::T().
Referenced by Foam::getOrAdd(), Enum< actionType >::getOrDefault(), multiFieldValue::read(), and Enum< actionType >::readEntry().
|
inline |
Definition at line 277 of file entry.H.
References entry::checkITstream(), and entry::stream().
Referenced by dynamicCodeContext::readEntry().
|
inline |
|
inline |
Definition at line 303 of file entry.H.
References entry::checkITstream(), and entry::stream().
|
pure virtual |
Implemented in primitiveEntry, dictionaryEntry, functionEntry, and dictionaryListEntry.
void operator= | ( | const entry & | e | ) |
Definition at line 187 of file entry.C.
References Foam::constant::electromagnetic::e.
Definition at line 198 of file entry.C.
References Foam::constant::electromagnetic::e, and StringStreamAllocator< StreamType >::str().
Definition at line 221 of file entry.C.
References Foam::constant::electromagnetic::e, and Foam::operator==().
|
static |
Definition at line 123 of file entry.H.
Referenced by entry::New().
|
static |
Definition at line 126 of file entry.H.
Referenced by entry::resetInputMode().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.