35 inline void Foam::UIPstream::checkEof()
37 if (externalBufPosition_ == messageSize_)
45 inline void Foam::UIPstream::readFromBuffer(
T& t)
47 const size_t align =
sizeof(
T);
48 externalBufPosition_ = align + ((externalBufPosition_ - 1) & ~(align - 1));
50 t =
reinterpret_cast<T&
>(externalBuf_[externalBufPosition_]);
51 externalBufPosition_ +=
sizeof(
T);
56 inline void Foam::UIPstream::readFromBuffer
65 externalBufPosition_ =
67 + ((externalBufPosition_ - 1) & ~(align - 1));
70 const char* bufPtr = &externalBuf_[externalBufPosition_];
71 char* dataPtr =
reinterpret_cast<char*
>(data);
73 while (i--) *dataPtr++ = *bufPtr++;
74 externalBufPosition_ += count;
83 if (clearAtEnd_ &&
eof())
87 Pout<<
"UIPstream::~UIPstream() : tag:" << tag_
88 <<
" fromProcNo:" << fromProcNo_
89 <<
" clearing externalBuf_ of size " 90 << externalBuf_.
size()
91 <<
" messageSize_:" << messageSize_ <<
endl;
184 string* pval =
new string;
266 c = externalBuf_[externalBufPosition_];
267 externalBufPosition_++;
277 str = &externalBuf_[externalBufPosition_];
278 externalBufPosition_ += len + 1;
288 str = &externalBuf_[externalBufPosition_];
289 externalBufPosition_ += len + 1;
321 <<
"stream format not binary" 325 readFromBuffer(data, count, 8);
332 externalBufPosition_ = 0;
339 os <<
"Reading from processor " << fromProcNo_
340 <<
" using communicator " << comm_
341 <<
" and tag " << tag_
bool eof() const
Return true if end of input seen.
streamFormat format() const
Return current stream format.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#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.
void setBad()
Set stream to be bad.
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.
double doubleScalar
Double precision floating point scalar type.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
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)
void setEof()
Set stream to have reached eof.
bool getBack(token &)
Get the put back token if there is one and return true.
label lineNumber() const
Return current stream line number.
const dimensionedScalar c
Speed of light in a vacuum.
void clearStorage()
Clear the list and delete storage.
punctuationToken
Standard punctuation tokens.
void print(Ostream &) const
Print description of IOstream to Ostream.
A class for handling character strings derived from std::string.
static autoPtr< compound > New(const word &type, Istream &)
Select null constructed.