EclOutput: Add Stream Flushing Operation

Calls '.flush()' on the contained 'ofstream' object.  Needed as a
means of ensuring that bits in the internal buffers of the I/O
system are promptly output to permanent storage.  This, in turn, is
needed in upcoming work on the summary writing feature.
This commit is contained in:
Bård Skaflestad
2019-10-05 14:19:55 +02:00
parent cefdd86f1b
commit 5a5a87d602
3 changed files with 6 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ public:
}
void message(const std::string& msg);
void flushStream();
friend class OutputStream::Restart;
friend class OutputStream::SummarySpecification;

View File

@@ -86,6 +86,10 @@ void EclOutput::message(const std::string& msg)
this->write(msg, std::vector<char>{});
}
void EclOutput::flushStream()
{
this->ofileH.flush();
}
void EclOutput::writeBinaryHeader(const std::string&arrName, int size, eclArrType arrType)
{

View File

@@ -744,8 +744,7 @@ void Opm::EclIO::OutputStream::SummarySpecification::rewindStream()
void Opm::EclIO::OutputStream::SummarySpecification::flushStream()
{
// Benefits from EclOutput friendship
this->stream().ofileH.flush();
this->stream().flushStream();
}
Opm::EclIO::EclOutput&