55template<
class IntType,
class FloatType>
72 is.
readRaw(
reinterpret_cast<char*
>(&tup),
sizeof(inputType));
74 if constexpr (
sizeof(Foam::label) <
sizeof(IntType))
81 data->
first() = tup.first();
84 if constexpr (
sizeof(Foam::scalar) <
sizeof(FloatType))
93 data->
second().
x() = tup.second().x();
94 data->
second().
y() = tup.second().y();
95 data->
second().
z() = tup.second().z();
112 std::streamsize byteCount
118 is.
read(byteData, byteCount);
130 case ((
sizeof(int32_t) << 8) |
sizeof(
float)) :
132 reading<int32_t, float>(is, data, nElem);
135 case ((
sizeof(int32_t) << 8) |
sizeof(
double)) :
137 reading<int32_t, double>(is, data, nElem);
140 case ((
sizeof(int64_t) << 8) |
sizeof(
float)) :
142 reading<int32_t, float>(is, data, nElem);
145 case ((
sizeof(int64_t) << 8) |
sizeof(
double)) :
147 reading<int32_t, double>(is, data, nElem);
Macros for easy insertion into run-time selection tables.
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes associated with the stream.
bool checkNativeSizes() const noexcept
Test if the label/scalar byte-size associated with the stream are the native label/scalar sizes.
bool fatalCheckNativeSizes(const char *operation) const
Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes.
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes associated with the stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual bool endRawRead()=0
End of low-level raw binary read.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
virtual Istream & readRaw(char *data, std::streamsize count)=0
Low-level raw binary read (without possible block delimiters). Reading into a null pointer shall idea...
virtual Istream & read(token &)=0
Return next token from stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Access the first element.
const T2 & second() const noexcept
Access the second element.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
A traits class, which is primarily used for primitives and vector-space.
Accumulates point constraints through successive applications of the applyConstraint function.
void readContiguous(Istream &is, char *data, std::streamsize byteCount)
Read binary block of contiguous data, possibly with conversion.
List< pointConstraint > pointConstraintList
List of pointConstraint.
constexpr int32_t narrowInt32(const int64_t val) noexcept
Type narrowing from int64_t to int32_t.
constexpr float narrowFloat(const double val) noexcept
Type narrowing from double to float.
#define addCompoundToRunTimeSelectionTable(Type, Tag)
Add compound to selection tables, lookup using typeName.
#define defineCompoundTypeName(Type, UnusedTag)
Define compound using Type for its name.