39 #ifndef Foam_primitives_int32_H 40 #define Foam_primitives_int32_H 60 return word(std::to_string(val),
false);
70 return word(std::to_string(val),
false);
75 inline int32_t
mag(
const int32_t val)
92 inline int32_t
readInt32(
const std::string& str)
99 bool readInt32(
const char* buf, int32_t& val);
103 inline bool readInt32(
const std::string& str, int32_t& val)
110 inline bool read(
const char* buf, int32_t& val)
117 inline bool read(
const std::string& str, int32_t& val)
123 Istream&
operator>>(Istream& is, int32_t& val);
130 #if (__SIZEOF_LONG__ == 4) 151 typedef int32_t cmptType;
154 typedef int32_t magType;
166 static constexpr
direction nComponents = 1;
171 static const char*
const typeName;
172 static const char*
const componentNames[];
173 static const int32_t
zero;
174 static const int32_t
one;
176 static const int32_t
max;
177 static const int32_t rootMax;
178 static const int32_t rootMin;
196 operator int32_t() const
noexcept {
return p_; }
199 operator int32_t&()
noexcept {
return p_; }
int32_t readInt32(Istream &is)
Read int32_t from stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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)...
A traits class, which is primarily used for primitives.
Extract name (as a word) from an object, typically using its name() method.
bool read(const char *buf, int32_t &val)
Same as readInt32.
pTraits(const Base &obj)
Copy construct from base class.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
word operator()(const int32_t val) const
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Direction is an 8-bit unsigned integer type used to represent Cartesian directions, components etc.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...