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;
306 c = externalBuf_[externalBufPosition_];
307 externalBufPosition_++;
317 str = &externalBuf_[externalBufPosition_];
318 externalBufPosition_ += len + 1;
328 str = &externalBuf_[externalBufPosition_];
329 externalBufPosition_ += len + 1;
368 <<
"stream format not binary"
379 externalBufPosition_ = 0;
386 os <<
"Reading from processor " << fromProcNo_
387 <<
" using communicator " << comm_
388 <<
" 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.
Database for solution and other reduced data.
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 &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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"))