232 virtual label
size()
const = 0;
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;
368 inline explicit
token(const
float val, label lineNum=0)
noexcept;
371 inline explicit
token(const
double 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);
641 inline bool operator==(
const std::string&
s)
const;
651 inline bool operator!=(
const std::string&
s)
const;
661 friend ostream& operator<<(ostream& os, const InfoProxy<token>& ct);
702 Ostream&
operator<<(Ostream&
os,
const token::compound& ct);
704 ostream& operator<<(ostream& os, const InfoProxy<token>& ip);
707 Ostream& operator<<(Ostream& os, const InfoProxy<token>& ip);
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); Subtract or start of negative number.
Begin block [isseparator].
static const token undefinedToken
An undefined token.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
double doubleScalarToken() const
Return double value.
Compound(const T &val)
Copy construct.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
bool operator!=(const token &tok) const
bool isDouble() const noexcept
Token is DOUBLE.
Left parenthesis [isseparator].
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
punctuationToken pToken() const
Return punctuation character.
constexpr token() noexcept
Default construct, initialized to an UNDEFINED token.
compound & transferCompoundToken()
Return reference to compound and mark internally as released.
single character punctuation
Reference counter for various OpenFOAM components.
stream flag (1-byte bitmask)
bool isCompound() const noexcept
Token is COMPOUND.
scalar number() const
Return label, float or double value.
InfoProxy< token > info() const
Return info proxy for printing token information to a stream.
Begin dimensions [isseparator].
const word & wordToken() const
Return const reference to the word contents.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
declareRunTimeSelectionTable(autoPtr, compound, Istream,(Istream &is),(is))
Declare run-time constructor selection table.
A token holds an item read from Istream.
tokenType
Enumeration defining the types of token.
bool moved() const noexcept
Get compound transferred status.
tokenType type() const noexcept
Return the token type.
bool isFlag() const noexcept
Token is FLAG.
Begin string with double quote.
void swap(token &tok)
Swap token contents: type, data, line-number.
friend Ostream & operator<<(Ostream &os, const token &tok)
TypeName("compound")
Declare type-name, virtual type (with debug switch)
Begin list [isseparator].
Subtract or start of negative number.
Assignment/equals [isseparator].
float floatToken() const
Return float value.
bool isExpression() const noexcept
Token is EXPRESSION (string variant)
bool isSeparator() const noexcept
Token is PUNCTUATION and isseparator.
virtual ~compound() noexcept=default
Destructor.
bool undefined() const noexcept
Token is UNDEFINED.
scalar scalarToken() const
Return float or double value.
bool boolToken() const
Return boolean token value.
Dollar - start variable or expression.
word name() const
Return the name of the token type.
static constexpr const char *const typeName
The type name is "token".
End dimensions [isseparator].
bool isScalar() const noexcept
Token is FLOAT or DOUBLE.
bool isString() const noexcept
Token is string-variant (STRING, EXPRESSION, VARIABLE, VERBATIM)
int flagToken() const
Return flag bitmask value.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Right square bracket [isseparator].
Abstract base class for complex tokens.
A templated class for holding compound tokens.
Right parenthesis [isseparator].
Compound type such as List<label> etc.
label lineNumber() const noexcept
The line number for the token.
double doubleToken() const
Return double value.
Left square bracket [isseparator].
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
bool isStringType() const noexcept
Token is word-variant or string-variant (WORD, DIRECTIVE, STRING, EXPRESSION, VARIABLE, VERBATIM)
A class for handling words, derived from Foam::string.
static bool isseparator(int c) noexcept
True if the character is a punctuation separator (eg, in ISstream).
Istream & operator>>(Istream &, directionInfo &)
End string with double quote.
flagType
Stream or output control flags (1-byte width)
void setBad()
Clear token and set to be ERROR.
punctuationToken
Standard punctuation tokens (a character)
const compound & compoundToken() const
Read access for compound token.
static autoPtr< compound > New(const word &type, Istream &is)
Construct compound from Istream.
float (single-precision) type
float floatScalarToken() const
Return float value.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool isBool() const noexcept
Token is BOOL.
constexpr compound() noexcept
Default construct.
static bool isCompound(const word &name)
Test if name is a known (registered) compound type.
bool setType(const tokenType tokType) noexcept
Change the token type, for similar types.
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
OBJstream os(runTime.globalPath()/outputName)
bool isFloatScalar() const
Token is FLOAT.
bool isDoubleScalar() const
Token is DOUBLE.
const string & stringToken() const
Return const reference to the string contents.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Left brace [isseparator].
static token flag(int bitmask) noexcept
Create a token with stream flags, no sanity check.
bool operator==(const token &tok) const
Foam::string (usually double-quoted)
void operator=(const token &tok)
Copy assign.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
bool isFloat() const noexcept
Token is FLOAT.
void reset()
Reset token to UNDEFINED and clear any allocated storage.
virtual label size() const =0
The size of the underlying content.
A helper class for outputting values to Ostream.
const dimensionedScalar c
Speed of light in a vacuum.
label labelToken() const
Return label value.
double (double-precision) type
Right brace [isseparator].
bool isLabel() const noexcept
Token is LABEL.
virtual void write(Ostream &os) const
Redirect write to underlying content.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Macros to ease declaration of run-time selection tables.
Question mark (eg, ternary)
bool isVariable() const noexcept
Token is VARIABLE (string variant)
bool isDirective() const noexcept
Token is DIRECTIVE (word variant)
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))
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
virtual void write(Ostream &os) const =0
Redirect write to underlying content.
friend Ostream & operator<<(Ostream &os, const compound &ct)
Output operator.
bool isVerbatim() const noexcept
Token is VERBATIM string (string variant)
Hash - directive or start verbatim string.
virtual label size() const
The size of the underlying content.
bool isQuotedString() const noexcept
Token is (quoted) STRING (string variant)
TypeName("Compound<T>")
Declare type-name, virtual type (with debug switch)