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:
@@ -72,6 +72,7 @@ public:
|
||||
}
|
||||
|
||||
void message(const std::string& msg);
|
||||
void flushStream();
|
||||
|
||||
friend class OutputStream::Restart;
|
||||
friend class OutputStream::SummarySpecification;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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&
|
||||
|
||||
Reference in New Issue
Block a user