46 auto iter = toks.
begin();
54 for (
direction cmpt = 0; cmpt < nCmpt; ++cmpt)
117 for (label endCmpti = firstCmpti; endCmpti < is.
size(); ++endCmpti)
119 const token& tok = is[endCmpti];
130 switch (endCmpti - firstCmpti)
168 else if (tok0.
good())
199 const std::string& str,
214 std::memset(static_cast<void*>(
this),
'\0',
sizeof(*
this));
219 void Foam::expressions::exprValue::deepCopy(
const exprValue& rhs)
224 std::memcpy(static_cast<void*>(
this), &rhs,
sizeof(*
this));
259 #define doLocalCode(Type, UnusedParam) \ 261 case expressions::valueTypeCode::type_##Type : \ 263 const Type* dataPtr = data_.get<Type>(); \ 266 fillTokens<Type>(*dataPtr, toks); \ 308 #define doLocalCode(Type, UnusedParam) \ 310 case expressions::valueTypeCode::type_##Type : \ 312 const Type* dataPtr = data_.get<Type>(); \ 374 return readTokens(*stream);
386 typeCode_ = whichCode;
394 typeCode_ = whichCode;
413 #define doLocalCode(Type, UnusedParam) \ 415 case expressions::valueTypeCode::type_##Type : \ 417 data_.set<Type>(pTraits<Type>(is)); \ 418 typeCode_ = whichCode; \ 437 if (typeCode_ != rhs.typeCode_)
442 else if (
this == &rhs)
450 #define doLocalCode(Type, UnusedParam) \ 452 case expressions::valueTypeCode::type_##Type : \ 454 const Type* a = data_.get<Type>(); \ 455 const Type* b = rhs.data_.get<Type>(); \ 456 return (a && b && (*a == *b)); \ 506 const InfoProxy<expressions::exprValue>& iproxy
509 const auto& val = *iproxy;
void add_tokens(const token &tok)
Copy append a token at the current tokenIndex, incrementing the index.
void fillTokens< scalar >(const scalar &val, tokenList &toks)
Specialized for scalar.
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
bool isPunctuation() const noexcept
Token is PUNCTUATION.
void size(const label n)
Older name for setAddressableSize.
bool good() const noexcept
True if the Switch represents a valid enumeration.
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
void seek(label pos)
Move tokenIndex to the specified position.
bool bad() const noexcept
True if stream is corrupted.
static void fillTokens(const Type &val, tokenList &toks)
void resize(const label len)
Adjust allocated size of list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A polymorphic typed union of simple primitive and VectorSpace types. It uses a 'fatter' representatio...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds an item read from Istream.
T & front()
Access first element of the list, position [0].
A traits class, which is primarily used for primitives and vector-space.
No type, or default initialized type.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Begin list [isseparator].
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
label tokenIndex() const noexcept
The current token index when reading, or the insertion point.
label nRemainingTokens() const noexcept
Number of tokens remaining.
List< token > tokenList
List of token, used for dictionary primitive entry (for example)
bool isScalar() const noexcept
Token is FLOAT or DOUBLE.
const token & peek() const
Failsafe peek at what the next read would return, including handling of any putback.
void fillTokens< bool >(const bool &val, tokenList &toks)
Specialized for bool.
Invalid/unknown/error type.
A class for handling words, derived from Foam::string.
static expressions::valueTypeCode peekType(const ITstream &is)
Detect the type from the available tokens.
bool hasPutback() const noexcept
True if putback token is in use.
static bool read(const std::string &str, exprValue &val)
Read entire string as a exprValue, skipping leading/trailing whitespace.
valueTypeCode
An enumeration of known and expected expression value types.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
bool operator<(const exprValue &rhs) const
Compare (type,value) - currently not implemented.
void write(Ostream &os, bool prune=false) const
Write the (type-specific) content.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
word valueTypeName() const
The name for the value type. Similar to pTraits typeName.
bool readTokens(ITstream &is)
Guess type and read tokens (if possible)
bool operator==(const exprValue &rhs) const
Compare (type,value) for equality.
OBJstream os(runTime.globalPath()/outputName)
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
Simple type identifiers for polymorphic expression values. The definitions are similar to std::integr...
#define doLocalCode(Type, UnusedParam)
bool fatalCheck(const char *operation) const
Check IOstream status for given operation.
#define FOR_ALL_EXPR_VALUE_TYPES(Macro,...)
static token boolean(bool on) noexcept
Create a bool token.
expressions::valueTypeCode typeCode() const noexcept
The value type code.
bool isLabel() const noexcept
Token is LABEL.
T & back()
Access last element of the list, position [size()-1].
void fillTokens< label >(const label &val, tokenList &toks)
Specialized for label.
void clear()
Reset to 'none'.
bool skip(label n=1)
Move tokenIndex relative to the current position.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
An input stream of tokens.
tokenList tokens(bool prune=false) const
The exprValue as tokens.