ENH: PstreamBuffers: added clear function

This commit is contained in:
mattijs
2013-12-19 15:41:56 +00:00
parent 45e503847f
commit e5da46a674
2 changed files with 18 additions and 2 deletions

View File

@ -145,4 +145,19 @@ void Foam::PstreamBuffers::finishedSends(labelListList& sizes, const bool block)
} }
void Foam::PstreamBuffers::clear()
{
forAll(sendBuf_, i)
{
sendBuf_[i].clear();
}
forAll(recvBuf_, i)
{
recvBuf_[i].clear();
}
recvBufPos_ = 0;
finishedSendsCalled_ = false;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -112,8 +112,6 @@ class PstreamBuffers
bool finishedSendsCalled_; bool finishedSendsCalled_;
// Private Member Functions
public: public:
// Static data // Static data
@ -155,6 +153,9 @@ public:
// non-blocking. // non-blocking.
void finishedSends(labelListList& sizes, const bool block = true); void finishedSends(labelListList& sizes, const bool block = true);
//- Clear storage and reset
void clear();
}; };