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;
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" 372 readFromBuffer(data, count, 8);
379 externalBufPosition_ = 0;
386 os <<
"Reading from processor " << fromProcNo_
387 <<
" using communicator " << comm_
388 <<
" and tag " << tag_
A class for handling verbatimStrings, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
A token holds items read from Istream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
label lineNumber() const
Return current stream line number.
const dimensionedScalar c
Speed of light in a vacuum.
void setBad()
Set stream to be bad.
A functionName is a word starting with '#'.
A class for handling words, derived from string.
float floatScalar
Float precision floating point scalar type.
Istream & rewind()
Rewind and return the stream so that it may be read again.
punctuationToken
Standard punctuation tokens.
double doubleScalar
Double precision floating point scalar type.
streamFormat format() const
Return current stream format.
errorManip< error > abort(error &err)
void print(Ostream &) const
Print description of IOstream to Ostream.
bool eof() const
Return true if end of input seen.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
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.
static bool isCompound(const word &name)
Return true if name is a compound type.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
long double longDoubleScalar
Lang double precision floating point scalar type.
void setEof()
Set stream to have reached eof.
bool getBack(token &)
Get the put back token if there is one and return true.
prefixOSstream Pout(cout, "Pout")
void clearStorage()
Clear the list and delete storage.
A class for handling character strings derived from std::string.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.