39 #ifndef Foam_primitives_label_H 40 #define Foam_primitives_label_H 47 #define INT_ADD_SIZE(x,s,y) x ## s ## y 48 #define INT_ADD_DEF_SIZE(x,s,y) INT_ADD_SIZE(x,s,y) 49 #define INT_SIZE(x,y) INT_ADD_DEF_SIZE(x,WM_LABEL_SIZE,y) 82 inline bool readLabel(
const char* buf, label& val)
90 inline bool readLabel(
const std::string& str, label& val)
117 label
pow(label a, label
b);
139 inline bool equal(
const T& a,
const T&
b)
160 template<
class>
struct labelOp;
166 constexpr label operator()(
const int32_t& val)
const noexcept 175 struct labelOp<int64_t>
177 constexpr label operator()(
const int64_t& val)
const noexcept 179 #if WM_LABEL_SIZE == 32 181 #elif WM_LABEL_SIZE == 64 199 (val < INT32_MIN) ? INT32_MIN
200 : (val > INT32_MAX) ? INT32_MAX
201 : static_cast<int32_t>(val)
215 #undef INT_ADD_DEF_SIZE
bool equal(const T &a, const T &b)
Compare two values for equality.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
int readInt(Istream &is)
Read int from stream.
Typedefs for label/uLabel without requiring label.H.
Conversion/extraction to label operation.
int32_t narrowInt32(const int64_t val)
Type narrowing from int64_t to int32_t.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
label factorial(label n)
Evaluate n! : 0 < n <= 12.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label readRawLabel(Istream &is)
Read raw label from binary stream.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)