36 inline void Foam::UIPstream::checkEof()
38 if (externalBufPosition_ == messageSize_)
46 inline void Foam::UIPstream::readFromBuffer(
T& t)
48 const size_t align =
sizeof(
T);
49 externalBufPosition_ = align + ((externalBufPosition_ - 1) & ~(align - 1));
51 t =
reinterpret_cast<T&
>(externalBuf_[externalBufPosition_]);
52 externalBufPosition_ +=
sizeof(
T);
57 inline void Foam::UIPstream::readFromBuffer
66 externalBufPosition_ =
68 + ((externalBufPosition_ - 1) & ~(align - 1));
71 const char* bufPtr = &externalBuf_[externalBufPosition_];
72 char* dataPtr =
reinterpret_cast<char*
>(data);
74 while (i--) *dataPtr++ = *bufPtr++;
75 externalBufPosition_ +=
count;
84 if (clearAtEnd_ && eof())
88 Pout<<
"UIPstream::~UIPstream() : tag:" << tag_
89 <<
" fromProcNo:" << fromProcNo_
90 <<
" clearing externalBuf_ of size "
91 << externalBuf_.size()
92 <<
" messageSize_:" << messageSize_ <<
endl;
94 externalBuf_.clearStorage();
157 if (pval->size() > 1 && (*pval)[0] ==
'#')
180 <<
"Binary IO of function names not supported"
189 <<
"Binary IO of variables not supported"
197 string* pval =
new string;
351 c = externalBuf_[externalBufPosition_];
352 externalBufPosition_++;
362 str = &externalBuf_[externalBufPosition_];
363 externalBufPosition_ += len + 1;
373 str = &externalBuf_[externalBufPosition_];
374 externalBufPosition_ += len + 1;
434 <<
"stream format not binary"
438 readFromBuffer(data,
count, 8);
445 externalBufPosition_ = 0;
452 os <<
"Reading from processor " << fromProcNo_
453 <<
" using communicator " << comm_
454 <<
" and tag " << tag_
void setEof()
Set stream to have reached eof.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool getBack(token &)
Get the put back token if there is one and return true.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Istream & rewind()
Rewind and return the stream so that it may be read again.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
void print(Ostream &) const
Print description of IOstream to Ostream.
A functionName is a word starting with '#'.
A class for handling character strings derived from std::string.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.
static bool isCompound(const word &name)
Return true if name is a compound type.
A token holds items read from Istream.
punctuationToken
Standard punctuation tokens.
A class for handling verbatimStrings, derived from string.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar c
Speed of light in a vacuum.
bool read(const char *, int32_t &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
double doubleScalar
Double precision floating point scalar type.
errorManip< error > abort(error &err)
float floatScalar
Float precision floating point scalar type.
prefixOSstream Pout(cout, "Pout")
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
long double longDoubleScalar
Lang double precision floating point scalar type.
word format(conversionProperties.lookup("format"))