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)
90inline bool readLabel(
const std::string& str, label& val)
111void readRawLabel(Istream& is, label* data,
size_t nElem = 1);
117label
pow(label a, label
b);
147 constexpr label
operator()(
const int32_t& val)
const noexcept
158 constexpr label
operator()(
const int64_t& val)
const noexcept
160 #if WM_LABEL_SIZE == 32
162 #elif WM_LABEL_SIZE == 64
180 (val < INT32_MIN) ? INT32_MIN
181 : (val > INT32_MAX) ? INT32_MAX
182 :
static_cast<int32_t
>(val)
196#undef INT_ADD_DEF_SIZE
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Typedefs for label/uLabel without requiring label.H.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components)
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
int32_t narrowInt32(const int64_t val)
Type narrowing from int64_t to int32_t.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
int readInt(Istream &is)
Read int from stream.
label readRawLabel(Istream &is)
Read raw label from binary stream.
label factorial(label n)
Evaluate n! : 0 < n <= 12.
constexpr label operator()(const int32_t &val) const noexcept
constexpr label operator()(const int64_t &val) const noexcept
Conversion/extraction to label operation.