ENH: UIPstream when reaches eof deletes the underlying buffer.

Only in PstreamBuffers mode. This makes sure that data from other processors
already handled gets deleted.
This commit is contained in:
mattijs
2010-03-04 15:03:10 +00:00
parent 18eb2d7099
commit e4b4bf2bf0
5 changed files with 40 additions and 1 deletions

View File

@ -38,6 +38,7 @@ Foam::UIPstream::UIPstream
DynamicList<char>& externalBuf,
label& externalBufPosition,
const int tag,
const bool clearAtEnd,
streamFormat format,
versionNumber version
)
@ -48,6 +49,7 @@ Foam::UIPstream::UIPstream
externalBuf_(externalBuf),
externalBufPosition_(externalBufPosition),
tag_(tag),
clearAtEnd_(clearAtEnd),
messageSize_(0)
{
notImplemented
@ -59,6 +61,7 @@ Foam::UIPstream::UIPstream
"DynamicList<char>&,"
"label&,"
"const int tag,"
"const bool,"
"streamFormat, versionNumber"
")"
);

View File

@ -42,6 +42,7 @@ Foam::UIPstream::UIPstream
DynamicList<char>& externalBuf,
label& externalBufPosition,
const int tag,
const bool clearAtEnd,
streamFormat format,
versionNumber version
)
@ -52,6 +53,7 @@ Foam::UIPstream::UIPstream
externalBuf_(externalBuf),
externalBufPosition_(externalBufPosition),
tag_(tag),
clearAtEnd_(clearAtEnd),
messageSize_(0)
{
setOpened();
@ -125,6 +127,7 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
externalBuf_(buffers.recvBuf_[fromProcNo]),
externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
tag_(buffers.tag_),
clearAtEnd_(true),
messageSize_(0)
{
if (commsType() != UPstream::scheduled && !buffers.finishedSendsCalled_)