A keyword and a list of tokens is an 'entry'. More...
#include <OpenFOAM/entry.H>
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.
Definition at line 66 of file entry.H.
Public Member Functions | |
entry (const keyType &) | |
Construct from keyword.
| |
entry (const entry &) | |
Construct as copy.
| |
virtual autoPtr< entry > | clone (const dictionary &parentDict) const =0 |
Construct on freestore as copy with reference to the.
| |
virtual autoPtr< entry > | clone () const |
Construct on freestore as copy.
| |
virtual | ~entry () |
Destructor.
| |
const keyType & | keyword () const |
Return keyword.
| |
keyType & | keyword () |
Return non-const access to keyword.
| |
virtual const fileName & | name () const =0 |
Return the dictionary name.
| |
virtual fileName & | name ()=0 |
Return the dictionary name.
| |
virtual label | startLineNumber () const =0 |
Return line number of first token in dictionary.
| |
virtual label | endLineNumber () const =0 |
Return line number of last token in dictionary.
| |
virtual bool | isStream () const |
Return true if this entry is a stream.
| |
virtual ITstream & | stream () const =0 |
Return token stream if this entry is a primitive entry.
| |
virtual bool | isDict () const |
Return true if this entry is a dictionary.
| |
virtual const dictionary & | dict () const =0 |
Return dictionary if this entry is a dictionary.
| |
virtual dictionary & | dict ()=0 |
Return non-const access to dictionary if this entry is a dictionary.
| |
virtual void | write (Ostream &) const =0 |
Write.
| |
void | operator= (const entry &) |
bool | operator== (const entry &) const |
bool | operator!= (const entry &) const |
Static Public Member Functions | |
static bool | New (dictionary &parentDict, Istream &) |
Construct from Istream and insert into dictionary.
| |
static autoPtr< entry > | New (Istream &is) |
Construct on freestore from Istream and return.
| |
Friends | |
Ostream & | operator<< (Ostream &, const entry &) |
virtual autoPtr<entry> clone | ( | const dictionary & | parentDict ) | const [pure virtual]
|
Construct on freestore as copy with reference to the.
dictionary the copy belongs to
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by dictionary::add(), and dictionary::set().
Foam::autoPtr< Foam::entry > clone | ( | ) | const [virtual]
|
Construct on freestore as copy.
Note: the parent directory is set to dictionary::null
Definition at line 44 of file entry.C.
References dictionary::null.
bool New | ( | dictionary & | parentDict, |
Istream & | is | ||
) | [static]
|
Construct from Istream and insert into dictionary.
Definition at line 88 of file entryIO.C.
References dictionary::add(), token::BEGIN_BLOCK, dictionary::clear(), entry::dict(), inputModeEntry::error(), includeEntry::execute(), functionEntry::execute(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorIn, entry::isDict(), dictionary::lookupEntryPtr(), inputModeEntry::merge(), inputModeEntry::overwrite(), inputModeEntry::protect(), Istream::putBack(), and dictionary::substituteKeyword().
Foam::autoPtr< Foam::entry > New | ( | Istream & | is ) | [static]
|
Construct on freestore from Istream and return.
Definition at line 194 of file entryIO.C.
References token::BEGIN_BLOCK, IOstream::fatalCheck(), dictionary::null, and Istream::putBack().
const keyType& keyword | ( | ) | const [inline]
|
Return keyword.
Definition at line 118 of file entry.H.
Referenced by dictionary::add(), cellModel::cellModel(), fieldAverageItem::fieldAverageItem(), phase::iNew::operator()(), Foam::operator<<(), Foam::operator>>(), phaseProperties::phaseProperties(), primitiveEntry::primitiveEntry(), dictionary::set(), and dictionaryEntry::write().
keyType& keyword | ( | ) | [inline]
|
virtual const fileName& name | ( | ) | const [pure virtual]
|
Return the dictionary name.
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by dictionary::add().
virtual fileName& name | ( | ) | [pure virtual]
|
Return the dictionary name.
Implemented in dictionaryEntry, and primitiveEntry.
virtual label startLineNumber | ( | ) | const [pure virtual]
|
Return line number of first token in dictionary.
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by dictionaryEntry::startLineNumber().
virtual label endLineNumber | ( | ) | const [pure virtual]
|
Return line number of last token in dictionary.
Implemented in dictionaryEntry, and primitiveEntry.
virtual bool isStream | ( | ) | const [inline, virtual]
|
Return true if this entry is a stream.
Reimplemented in primitiveEntry.
virtual ITstream& stream | ( | ) | const [pure virtual]
|
Return token stream if this entry is a primitive entry.
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by coordinateSystem::coordinateSystem(), lduMatrix::smoother::getName(), lduMatrix::preconditioner::getName(), dictionary::lookupOrAddDefault(), dictionary::lookupOrDefault(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), functionObjectList::read(), dictionary::readIfPresent(), and solution::upgradeSolverDict().
virtual bool isDict | ( | ) | const [inline, virtual]
|
Return true if this entry is a dictionary.
Reimplemented in dictionaryEntry.
Definition at line 151 of file entry.H.
Referenced by dictionary::add(), coordinateSystem::coordinateSystem(), lduMatrix::smoother::getName(), lduMatrix::preconditioner::getName(), dictionary::isDict(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), entry::New(), functionObjectList::read(), dictionary::set(), Foam::debug::switchSet(), and solution::upgradeSolverDict().
virtual const dictionary& dict | ( | ) | const [pure virtual]
|
Return dictionary if this entry is a dictionary.
Implemented in dictionaryEntry, and primitiveEntry.
Referenced by dictionary::add(), lduMatrix::smoother::getName(), lduMatrix::preconditioner::getName(), lduMatrix::smoother::New(), lduMatrix::preconditioner::New(), entry::New(), functionObjectList::read(), dictionary::set(), dictionary::subDict(), dictionary::subDictPtr(), dictionary::subOrEmptyDict(), and Foam::debug::switchSet().
virtual dictionary& dict | ( | ) | [pure virtual]
|
Return non-const access to dictionary if this entry is a dictionary.
Implemented in dictionaryEntry, and primitiveEntry.
virtual void write | ( | Ostream & | ) | const [pure virtual]
|
void operator= | ( | const entry & | e ) |
Definition at line 52 of file entry.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
bool operator== | ( | const entry & | e ) | const |
Definition at line 66 of file entry.C.
References e, and OStringStream::str().
bool operator!= | ( | const entry & | e ) | const |
Definition at line 85 of file entry.C.
References Foam::operator==().