52 Foam::token Foam::functionEntry::readLine(
const word& key, Istream& is)
55 dynamic_cast<ISstream&
>(is).getLine(s);
57 return token(
string(key+s), is.lineNumber());
63 Foam::functionEntry::functionEntry
82 const word& functionName,
89 "functionEntry::execute" 90 "(const word& functionName, dictionary& parentDict, Istream&)" 93 if (!executedictionaryIstreamMemberFunctionTablePtr_)
95 cerr<<
"functionEntry::execute" 96 <<
"(const word&, dictionary&, Istream&)" 97 <<
" not yet initialized, function = " 104 executedictionaryIstreamMemberFunctionTable::iterator mfIter =
105 executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
107 if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
110 <<
"Unknown functionEntry '" << functionName
113 <<
"Valid functionEntries are :" <<
endl 114 << executedictionaryIstreamMemberFunctionTablePtr_->toc()
118 return mfIter()(parentDict, is);
124 const word& functionName,
132 "functionEntry::execute" 133 "(const word&, const dictionary&, primitiveEntry&, Istream&)" 136 if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
138 cerr<<
"functionEntry::execute" 139 <<
"(const word&, const dictionary&, primitiveEntry&, Istream&)" 140 <<
" not yet initialized, function = " 147 executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
148 executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
150 if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end())
153 <<
"Unknown functionEntry '" << functionName
156 <<
"Valid functionEntries are :" <<
endl 157 << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
161 return mfIter()(parentDict, entry, is);
168 const token& t = operator[](0);
171 for (
size_t i = 0; i < s.size(); i++)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds items read from Istream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label lineNumber() const
Return current stream line number.
virtual void write(Ostream &) const
Write.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A keyword and a list of tokens is a 'primitiveEntry'. An primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fileName & name() const
Return the dictionary name.
A class for handling words, derived from string.
virtual const fileName & name() const
Return the name of the stream.
static bool execute(const word &functionName, dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
void fatalCheck(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const string & stringToken() const
word name(const complex &)
Return a string representation of a complex.
virtual Ostream & write(const token &)=0
Write next token to stream.
defineMemberFunctionSelectionTable(edgeMesh, write, fileExtension)