Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Friends | List of all members
entry Class Referenceabstract

A keyword and a list of tokens is an 'entry'. More...

Inheritance diagram for entry:
Inheritance graph
[legend]
Collaboration diagram for entry:
Collaboration graph
[legend]

Public Types

enum  inputMode {
  MERGE, OVERWRITE, PROTECT, WARN,
  ERROR, GLOBAL
}
 

Public Member Functions

 entry (const keyType &keyword)
 
 entry (const entry &e)
 
virtual autoPtr< entryclone (const dictionary &parentDict) const =0
 
virtual autoPtr< entryclone () const
 
virtual ~entry ()=default
 
const keyTypekeyword () const noexcept
 
keyTypekeyword () noexcept
 
virtual const fileNamename () const =0
 
virtual fileNamename ()=0
 
virtual fileName relativeName () const =0
 
virtual label startLineNumber () const =0
 
virtual label endLineNumber () const =0
 
virtual bool isStream () const noexcept
 
virtual ITstreamstream () const =0
 
virtual bool isDict () const noexcept
 
virtual const dictionarydictPtr () const noexcept
 
virtual dictionarydictPtr () noexcept
 
virtual const dictionarydict () const =0
 
virtual dictionarydict ()=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< entryNew (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

Ostreamoperator<< (Ostream &os, const entry &e)
 

Detailed Description

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.

Source files

Definition at line 63 of file entry.H.

Member Enumeration Documentation

◆ inputMode

enum inputMode
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.

Definition at line 72 of file entry.H.

Constructor & Destructor Documentation

◆ entry() [1/2]

entry ( const keyType keyword)

Definition at line 62 of file entry.C.

◆ entry() [2/2]

entry ( const entry e)

Definition at line 69 of file entry.C.

◆ ~entry()

virtual ~entry ( )
virtualdefault

Member Function Documentation

◆ reportReadWarning()

void reportReadWarning ( const IOstream is,
const std::string &  msg 
)
staticprotected

Definition at line 41 of file entry.C.

References Foam::endl(), IOstream::lineNumber(), and IOstream::relativeName().

Here is the call graph for this function:

◆ clone() [1/2]

virtual autoPtr<entry> clone ( const dictionary parentDict) const
pure virtual

◆ clone() [2/2]

Foam::autoPtr< Foam::entry > clone ( ) const
virtual

Definition at line 76 of file entry.C.

References dictionary::null.

◆ New() [1/2]

bool New ( dictionary parentDict,
Istream is,
const inputMode  inpMode = inputMode::GLOBAL,
const int  endChar = 0 
)
static

◆ New() [2/2]

Foam::autoPtr< Foam::entry > New ( Istream is)
static

Definition at line 456 of file entryIO.C.

References token::BEGIN_BLOCK, IOstream::fatalCheck(), FUNCTION_NAME, dictionary::null, Istream::putBack(), and autoPtr::reset().

Here is the call graph for this function:

◆ resetInputMode()

void resetInputMode ( )
static

Definition at line 54 of file entry.C.

References entry::globalInputMode, and entry::MERGE.

Referenced by dictionary::dictionary(), and Foam::operator>>().

Here is the caller graph for this function:

◆ keyword() [1/2]

const keyType& keyword ( ) const
inlinenoexcept

◆ keyword() [2/2]

keyType& keyword ( )
inlinenoexcept

Definition at line 197 of file entry.H.

◆ name() [1/2]

virtual const fileName& name ( ) const
pure virtual

Implemented in primitiveEntry, and dictionaryEntry.

Referenced by dictionary::add().

Here is the caller graph for this function:

◆ name() [2/2]

virtual fileName& name ( )
pure virtual

Implemented in primitiveEntry, and dictionaryEntry.

◆ relativeName()

virtual fileName relativeName ( ) const
pure virtual

Implemented in primitiveEntry, and dictionaryEntry.

◆ startLineNumber()

virtual label startLineNumber ( ) const
pure virtual

Implemented in primitiveEntry, and dictionaryEntry.

Referenced by dynamicCodeContext::readEntry().

Here is the caller graph for this function:

◆ endLineNumber()

virtual label endLineNumber ( ) const
pure virtual

Implemented in primitiveEntry, and dictionaryEntry.

◆ isStream()

virtual bool isStream ( ) const
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().

Here is the caller graph for this function:

◆ stream()

virtual ITstream& stream ( ) const
pure virtual

◆ isDict()

virtual bool isDict ( ) const
inlinevirtualnoexcept

◆ dictPtr() [1/2]

virtual const dictionary* dictPtr ( ) const
inlinevirtualnoexcept

Reimplemented in dictionaryEntry.

Definition at line 236 of file entry.H.

Referenced by dictionary::cfindScopedDict(), entry::isDict(), and dictionary::makeScopedDict().

Here is the caller graph for this function:

◆ dictPtr() [2/2]

virtual dictionary* dictPtr ( )
inlinevirtualnoexcept

Reimplemented in dictionaryEntry.

Definition at line 243 of file entry.H.

◆ dict() [1/2]

virtual const dictionary& dict ( ) const
pure virtual

◆ dict() [2/2]

virtual dictionary& dict ( )
pure virtual

Implemented in dictionaryEntry, and primitiveEntry.

◆ checkITstream()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

T get ( ) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readEntry()

void readEntry ( T val) const
inline

Definition at line 277 of file entry.H.

References entry::checkITstream(), and entry::stream().

Referenced by dynamicCodeContext::readEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCheck()

T getCheck ( const Predicate &  pred) const
inline

Definition at line 290 of file entry.H.

References Foam::T().

Here is the call graph for this function:

◆ readCheck()

void readCheck ( T val,
const Predicate &  pred 
) const
inline

Definition at line 303 of file entry.H.

References entry::checkITstream(), and entry::stream().

Here is the call graph for this function:

◆ write()

virtual void write ( Ostream os) const
pure virtual

◆ operator=()

void operator= ( const entry e)

Definition at line 187 of file entry.C.

References Foam::constant::electromagnetic::e.

◆ operator==()

bool operator== ( const entry e) const

Definition at line 198 of file entry.C.

References Foam::constant::electromagnetic::e, and StringStreamAllocator< StreamType >::str().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const entry e) const

Definition at line 221 of file entry.C.

References Foam::constant::electromagnetic::e, and Foam::operator==().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const entry e 
)
friend

Member Data Documentation

◆ disableFunctionEntries

int disableFunctionEntries
static

Definition at line 123 of file entry.H.

Referenced by entry::New().

◆ globalInputMode

Foam::entry::inputMode globalInputMode = inputMode::MERGE
static

Definition at line 126 of file entry.H.

Referenced by entry::resetInputMode().


The documentation for this class was generated from the following files: