Go to the documentation of this file.
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();
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_
int debug
Static debugging option.
Assignment/equals [isseparator].
double doubleScalar
A typedef for double.
static Ostream & output(Ostream &os, const IntRange< T > &range)
A class for handling words, derived from Foam::string.
label lineNumber() const noexcept
The line number for the token.
float floatScalar
A typedef for float.
bool read(const char *buf, int32_t &val)
Same as readInt32.
void rewind()
Rewind the stream so that it may be read again.
streamFormat format() const noexcept
Get the current stream format.
static Foam::word charToWord(char c)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A token holds an item read from Istream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
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)
Read into given buffer from given processor.
Subtract or start of negative number.
void setEof() noexcept
Set stream state as reached 'eof'.
word format(conversionProperties.get< word >("format"))
static label byteAlign(const label pos, const size_t align)
Begin dimensions [isseparator].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void processFlags(Istream &is, int flagMask)
bool isFlag() const noexcept
Token is FLAG.
static bool isCompound(const word &name)
Test if name is a known (registered) compound type.
void print(Ostream &os) const
Print stream description to Ostream.
End dimensions [isseparator].
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
Begin block [isseparator].
Istream & readRaw(char *data, std::streamsize count)
Low-level raw binary read.
bool getBack(token &tok)
Get the put-back token if there is one.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
tokenType
Enumeration defining the types of token.
stream flag (1-byte bitmask)
const dimensionedScalar c
Speed of light in a vacuum.
int flagToken() const
Return flag bitmask value.
static autoPtr< compound > New(const word &type, Istream &is)
Construct compound from Istream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Begin list [isseparator].
bool beginRawRead()
Start of low-level raw binary read.
bool setType(const tokenType tokType) noexcept
Change the token type, for similar types.
Database for solution data, solver performance and other reduced data.
punctuationToken
Standard punctuation tokens (a character)
dimensionedScalar pos(const dimensionedScalar &ds)
void setBad()
Clear token and set to be ERROR.