Go to the documentation of this file.
48 inline static void processFlags(Istream& is,
int flagMask)
62 inline static label
byteAlign(
const label
pos,
const size_t align)
67 ? (align + ((
pos - 1) & ~(align - 1)))
77 inline void Foam::UIPstream::checkEof()
79 if (recvBufPos_ == messageSize_)
86 inline void Foam::UIPstream::prepareBuffer(
const size_t align)
88 recvBufPos_ =
byteAlign(recvBufPos_, align);
93 inline void Foam::UIPstream::readFromBuffer(
T& val)
95 prepareBuffer(
sizeof(
T));
97 val =
reinterpret_cast<T&
>(recvBuf_[recvBufPos_]);
98 recvBufPos_ +=
sizeof(
T);
103 inline void Foam::UIPstream::readFromBuffer
109 const char*
const __restrict__ buf = &recvBuf_[recvBufPos_];
110 char*
const __restrict__
output =
reinterpret_cast<char*
>(data);
112 for (
size_t i = 0; i <
count; ++i)
117 recvBufPos_ +=
count;
122 inline Foam::Istream& Foam::UIPstream::readString(std::string& str)
132 str.assign(&recvBuf_[recvBufPos_], len);
149 if (clearAtEnd_ && eof())
153 Pout<<
"UIPstream::~UIPstream() : tag:" << tag_
154 <<
" fromProcNo:" << fromProcNo_
155 <<
" clearing receive buffer of size "
157 <<
" messageSize_:" << messageSize_ <<
endl;
159 recvBuf_.clearStorage();
213 t.lineNumber(this->lineNumber());
239 case token::tokenType::WORD :
240 case token::tokenType::DIRECTIVE :
263 case token::tokenType::STRING :
264 case token::tokenType::EXPRESSION :
265 case token::tokenType::VARIABLE :
266 case token::tokenType::VERBATIM :
282 case token::tokenType::LABEL :
297 case token::tokenType::FLOAT :
312 case token::tokenType::DOUBLE :
346 c = recvBuf_[recvBufPos_];
355 return readString(str);
361 return readString(str);
417 <<
"stream format not binary"
438 os <<
"Reading from processor " << fromProcNo_
439 <<
" using communicator " << comm_
440 <<
" and tag " << tag_
@ ASSIGN
Assignment/equals [isseparator].
double doubleScalar
Floating-point double precision scalar type.
@ COMMA
Comma [isseparator].
static Ostream & output(Ostream &os, const IntRange< T > &range)
A class for handling words, derived from Foam::string.
label lineNumber() const noexcept
@ PLUS
Addition [isseparator].
float floatScalar
Floating-point single precision scalar type.
bool read(const char *buf, int32_t &val)
streamFormat format() const noexcept
static Foam::word charToWord(char c)
Ostream & endl(Ostream &os)
A token holds an item read from Istream.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=UPstream::worldComm)
@ DIVIDE
Divide [isseparator].
@ MINUS
Subtract or start of negative number.
word format(conversionProperties.get< word >("format"))
static label byteAlign(const label pos, const size_t align)
@ BINARY
BINARY-mode stream.
@ BEGIN_SQR
Begin dimensions [isseparator].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
@ ASCII
ASCII-mode stream.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void processFlags(Istream &is, int flagMask)
bool isFlag() const noexcept
@ END_STATEMENT
End entry [isseparator].
static bool isCompound(const word &name)
void print(Ostream &os) const
@ END_BLOCK
End block [isseparator].
@ END_SQR
End dimensions [isseparator].
OBJstream os(runTime.globalPath()/outputName)
@ MULTIPLY
Multiply [isseparator].
errorManip< error > abort(error &err)
@ BEGIN_BLOCK
Begin block [isseparator].
Istream & readRaw(char *data, std::streamsize count)
@ ASCII
"ascii" (normal default)
#define FatalErrorInFunction
@ COLON
Colon [isseparator].
unsigned int count(const UList< bool > &bools, const bool val=true)
@ FLAG
stream flag (1-byte bitmask)
@ END_LIST
End list [isseparator].
const dimensionedScalar c
static autoPtr< compound > New(const word &type, Istream &is)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
@ BEGIN_LIST
Begin list [isseparator].
bool setType(const tokenType tokType) noexcept
Database for solution data, solver performance and other reduced data.
dimensionedScalar pos(const dimensionedScalar &ds)