226 void moved(
bool b)
noexcept
232 virtual label
size()
const = 0;
281 virtual label
size()
const
289 operator<<(os, static_cast<const T&>(*
this));
336 inline void setUndefined()
noexcept;
339 void parseError(const
char* expected) const;
365 inline explicit
token(const label val, label lineNum=0)
noexcept;
374 inline explicit
token(const
word& w, label lineNum=0);
377 inline explicit
token(const
string& str, label lineNum=0);
380 inline explicit
token(
word&& w, label lineNum=0);
383 inline explicit
token(
string&& str, label lineNum=0);
486 inline
bool isWord(const std::
string&
s) const;
548 inline scalar
number() const;
619 inline void operator=(
const string& str);
638 inline bool operator==(
const label val)
const noexcept;
641 inline bool operator==(
const std::string&
s)
const;
648 inline bool operator!=(
const label val)
const noexcept;
651 inline bool operator!=(
const std::string&
s)
const;
713#define defineCompoundTypeName(Type, UnusedTag) \
714 defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Type, 0);
717#define defineNamedCompoundTypeName(Type, Name) \
718 defineTemplateTypeNameAndDebugWithName(token::Compound<Type>, #Name, 0);
721#define addCompoundToRunTimeSelectionTable(Type, Tag) \
722 token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
723 add##Tag##IstreamConstructorToTable_;
726#define addNamedCompoundToRunTimeSelectionTable(Type, Tag, Name) \
727 token::compound::addIstreamConstructorToTable<token::Compound<Type>> \
728 add##Tag##IstreamConstructorToTable_(#Name);
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Reference counter for various OpenFOAM components.
A templated class for holding compound tokens.
virtual label size() const
The size of the underlying content.
virtual void write(Ostream &os) const
Redirect write to underlying content.
Compound(Istream &is)
Read construct from Istream.
TypeName("Compound<T>")
Declare type-name, virtual type (with debug switch)
Compound(const T &val)
Copy construct.
Compound(T &&val)
Move construct.
Abstract base class for complex tokens.
void moved(bool b) noexcept
Set compound transferred status.
TypeName("compound")
Declare type-name, virtual type (with debug switch)
constexpr compound() noexcept
Default construct.
friend Ostream & operator<<(Ostream &os, const compound &ct)
Output operator.
bool moved() const noexcept
Get compound transferred status.
static autoPtr< compound > New(const word &type, Istream &is)
Construct compound from Istream.
virtual ~compound() noexcept=default
Destructor.
virtual label size() const =0
The size of the underlying content.
declareRunTimeSelectionTable(autoPtr, compound, Istream,(Istream &is),(is))
Declare run-time constructor selection table.
virtual void write(Ostream &os) const =0
Redirect write to underlying content.
A token holds an item read from Istream.
doubleScalar doubleScalarToken() const
Return double value.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
friend ostream & operator<<(ostream &os, const InfoProxy< token > &ct)
floatScalar floatToken() const
Return float value.
friend Ostream & operator<<(Ostream &os, const punctuationToken &pt)
bool isDoubleScalar() const
Token is DOUBLE.
tokenType
Enumeration defining the types of token.
@ LABEL
label (integer) type
@ ERROR
Token error encountered.
@ DOUBLE
double (double-precision) type
@ FLAG
stream flag (1-byte bitmask)
@ UNDEFINED
An undefined token-type.
@ COMPOUND
Compound type such as List<label> etc.
@ FLOAT
float (single-precision) type
@ STRING
Foam::string (usually double-quoted)
@ PUNCTUATION
single character punctuation
label lineNumber() const noexcept
The line number for the token.
bool isBool() const noexcept
Token is BOOL.
bool isSeparator() const noexcept
Token is PUNCTUATION and isseparator.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
friend ostream & operator<<(ostream &os, const punctuationToken &pt)
bool isExpression() const noexcept
Token is EXPRESSION (string variant)
word name() const
Return the name of the token type.
punctuationToken
Standard punctuation tokens (a character)
@ LBRACE
Left brace [isseparator].
@ BEGIN_STRING
Begin string with double quote.
@ DIVIDE
Divide [isseparator].
@ BEGIN_BLOCK
Begin block [isseparator].
@ BEGIN_SQR
Begin dimensions [isseparator].
@ COLON
Colon [isseparator].
@ RPAREN
Right parenthesis [isseparator].
@ END_BLOCK
End block [isseparator].
@ HASH
Hash - directive or start verbatim string.
@ LPAREN
Left parenthesis [isseparator].
@ RSQUARE
Right square bracket [isseparator].
@ END_STRING
End string with double quote.
@ LSQUARE
Left square bracket [isseparator].
@ ASSIGN
Assignment/equals [isseparator].
@ SEMICOLON
Semicolon [isseparator].
@ END_STATEMENT
End entry [isseparator].
@ NULL_TOKEN
Nul character.
@ BEGIN_LIST
Begin list [isseparator].
@ PLUS
Addition [isseparator].
@ DOLLAR
Dollar - start variable or expression.
@ RBRACE
Right brace [isseparator].
@ SUBTRACT
Subtract or start of negative number.
@ END_LIST
End list [isseparator].
@ ADD
Addition [isseparator].
@ QUESTION
Question mark (eg, ternary)
@ END_SQR
End dimensions [isseparator].
@ MULTIPLY
Multiply [isseparator].
@ MINUS
Subtract or start of negative number.
@ COMMA
Comma [isseparator].
bool isLabel() const noexcept
Token is LABEL.
const string & stringToken() const
Return const reference to the string contents.
bool operator!=(const token &tok) const
punctuationToken pToken() const
Return punctuation character.
bool operator==(const token &tok) const
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
void setBad()
Clear token and set to be ERROR.
label labelToken() const
Return label value.
bool isDouble() const noexcept
Token is DOUBLE.
static bool isseparator(int c) noexcept
True if the character is a punctuation separator (eg, in ISstream).
bool isString() const noexcept
Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM)
flagType
Stream or output control flags (1-byte width)
@ BINARY
BINARY-mode stream.
@ ASCII
ASCII-mode stream.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
void swap(token &tok)
Swap token contents: type, data, line-number.
bool boolToken() const
Return boolean token value.
bool isScalar() const noexcept
Token is FLOAT or DOUBLE.
const compound & compoundToken() const
Read access for compound token.
bool isDirective() const noexcept
Token is DIRECTIVE (word variant)
bool isFloatScalar() const
Token is FLOAT.
static constexpr const char *const typeName
The type name is "token".
floatScalar floatScalarToken() const
Return float value.
bool isFlag() const noexcept
Token is FLAG.
bool setType(const tokenType tokType) noexcept
Change the token type, for similar types.
int flagToken() const
Return flag bitmask value.
doubleScalar doubleToken() const
Return double value.
friend Ostream & operator<<(Ostream &os, const token &tok)
bool undefined() const noexcept
Token is UNDEFINED.
tokenType type() const noexcept
Return the token type.
bool isQuotedString() const noexcept
Token is (quoted) STRING (string variant)
bool isCompound() const noexcept
Token is COMPOUND.
bool isFloat() const noexcept
Token is FLOAT.
bool isStringType() const noexcept
bool isVariable() const noexcept
Token is VARIABLE (string variant)
void reset()
Reset token to UNDEFINED and clear any allocated storage.
static const token undefinedToken
An undefined token.
const word & wordToken() const
Return const reference to the word contents.
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
scalar scalarToken() const
Return float or double value.
bool isVerbatim() const noexcept
Token is VERBATIM string (string variant)
static token flag(int bitmask) noexcept
Create a token with stream flags, no sanity check.
void operator=(const token &tok)
Copy assign.
scalar number() const
Return label, float or double value.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
double doubleScalar
A typedef for double.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)
float floatScalar
A typedef for float.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.