FreeFOAM The Cross-Platform CFD Toolkit
entry Class Reference

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

#include <OpenFOAM/entry.H>


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 66 of file entry.H.

+ Inheritance diagram for entry:
+ Collaboration diagram for entry:

List of all members.

Public Member Functions

 entry (const keyType &)
 Construct from keyword.
 entry (const entry &)
 Construct as copy.
virtual autoPtr< entryclone (const dictionary &parentDict) const =0
 Construct on freestore as copy with reference to the.
virtual autoPtr< entryclone () const
 Construct on freestore as copy.
virtual ~entry ()
 Destructor.
const keyTypekeyword () const
 Return keyword.
keyTypekeyword ()
 Return non-const access to keyword.
virtual const fileNamename () const =0
 Return the dictionary name.
virtual fileNamename ()=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 ITstreamstream () 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 dictionarydict () const =0
 Return dictionary if this entry is a dictionary.
virtual dictionarydict ()=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< entryNew (Istream &is)
 Construct on freestore from Istream and return.

Friends

Ostreamoperator<< (Ostream &, const entry &)

Additional Inherited Members


Constructor & Destructor Documentation

entry ( const keyType keyword)

Construct from keyword.

Definition at line 32 of file entry.C.

entry ( const entry e)

Construct as copy.

Definition at line 38 of file entry.C.

virtual ~entry ( )
inlinevirtual

Destructor.

Definition at line 111 of file entry.H.


Member Function Documentation

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 primitiveEntry, and dictionaryEntry.

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.

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

keyType& keyword ( )
inline

Return non-const access to keyword.

Definition at line 124 of file entry.H.

virtual const fileName& name ( ) const
pure virtual

Return the dictionary name.

Implemented in primitiveEntry, and dictionaryEntry.

Referenced by dictionary::add().

virtual fileName& name ( )
pure virtual

Return the dictionary name.

Implemented in primitiveEntry, and dictionaryEntry.

virtual label startLineNumber ( ) const
pure virtual

Return line number of first token in dictionary.

Implemented in primitiveEntry, and dictionaryEntry.

Referenced by dictionaryEntry::startLineNumber().

virtual label endLineNumber ( ) const
pure virtual

Return line number of last token in dictionary.

Implemented in primitiveEntry, and dictionaryEntry.

virtual bool isStream ( ) const
inlinevirtual

Return true if this entry is a stream.

Reimplemented in primitiveEntry.

Definition at line 142 of file entry.H.

virtual dictionary& dict ( )
pure virtual

Return non-const access to dictionary if this entry is a dictionary.

Implemented in primitiveEntry, and dictionaryEntry.

virtual void write ( Ostream ) const
pure virtual

Write.

Implemented in primitiveEntry, and dictionaryEntry.

Referenced by Foam::operator<<().

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


Friends And Related Function Documentation

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

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