48 void Foam::token::parseError(
const char* expected)
const 51 <<
"Parse error, expected a " << expected
60 const word& compoundType
63 auto* ctorPtr = emptyConstructorTable(compoundType);
71 *emptyConstructorTablePtr_
81 const word& compoundType,
83 const bool readContent
86 auto* ctorPtr = emptyConstructorTable(compoundType);
95 *emptyConstructorTablePtr_
99 autoPtr<token::compound> aptr(ctorPtr());
126 emptyConstructorTablePtr_
127 && emptyConstructorTablePtr_->contains(compoundType)
134 const word& compoundType,
136 const bool readContent
142 auto* ctorPtr = token::compound::emptyConstructorTable(compoundType);
149 autoPtr<token::compound> aptr(ctorPtr());
158 (*this) = std::move(aptr);
166 if (type_ != tokenType::COMPOUND)
168 parseError(
"compound");
171 if (data_.compoundPtr->moved())
176 <<
"compound has already been transferred from token\n " 182 <<
"compound has already been transferred from token\n " 205 data_.compoundPtr->moved(
true);
208 return *data_.compoundPtr;
static bool isCompound(const word &compoundType)
True if a known (registered) compound type.
static const token undefinedToken
An undefined token.
static autoPtr< compound > New(const word &compoundType)
Default construct specified compound type.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#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 an item read from Istream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool readCompoundToken(const word &compoundType, Istream &is, const bool readContent=true)
Default construct the specified compound type and read from stream.
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
token::compound tokenCompound
Abstract base class for complex tokens.
defineTypeName(manifoldCellsMeshObject)
compound & transferCompoundToken(const Istream *is=nullptr)
Return reference to compound and mark internally as released.
A class for handling words, derived from Foam::string.
errorManip< error > abort(error &err)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
InfoProxy< token > info() const noexcept
Return info proxy, for printing token information to a stream.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...