Commit 72f54617 authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Add option in XdmfHeavyDataWriter to release data from arrays after

writing to disk.
parent c04961b4
...@@ -34,7 +34,8 @@ XdmfHeavyDataWriter::XdmfHeavyDataWriter() : ...@@ -34,7 +34,8 @@ XdmfHeavyDataWriter::XdmfHeavyDataWriter() :
XdmfHeavyDataWriter::XdmfHeavyDataWriter(const std::string & filePath) : XdmfHeavyDataWriter::XdmfHeavyDataWriter(const std::string & filePath) :
mDataSetId(0), mDataSetId(0),
mFilePath(XdmfSystemUtils::getRealPath(filePath)), mFilePath(XdmfSystemUtils::getRealPath(filePath)),
mMode(Default) mMode(Default),
mReleaseData(false)
{ {
} }
...@@ -54,8 +55,20 @@ XdmfHeavyDataWriter::getMode() const ...@@ -54,8 +55,20 @@ XdmfHeavyDataWriter::getMode() const
return mMode; return mMode;
} }
bool
XdmfHeavyDataWriter::getReleaseData() const
{
return mReleaseData;
}
void void
XdmfHeavyDataWriter::setMode(const Mode mode) XdmfHeavyDataWriter::setMode(const Mode mode)
{ {
mMode = mode; mMode = mode;
} }
void
XdmfHeavyDataWriter::setReleaseData(const bool releaseData)
{
mReleaseData = releaseData;
}
...@@ -86,6 +86,13 @@ public: ...@@ -86,6 +86,13 @@ public:
*/ */
Mode getMode() const; Mode getMode() const;
/**
* Get whether to release data from memory after writing to disk.
*
* @return true if data is freed after writing
*/
bool getReleaseData() const;
/** /**
* Set the mode of operation for this writer. * Set the mode of operation for this writer.
* *
...@@ -93,6 +100,13 @@ public: ...@@ -93,6 +100,13 @@ public:
*/ */
void setMode(const Mode mode); void setMode(const Mode mode);
/**
* Set whether to release data from memory after writing to disk.
*
* @param releaseData true if data should be freed after writing
*/
void setReleaseData(const bool releaseData = true);
/** /**
* Write an XdmfArray to heavy data file on disk. * Write an XdmfArray to heavy data file on disk.
* *
...@@ -110,6 +124,7 @@ protected: ...@@ -110,6 +124,7 @@ protected:
int mDataSetId; int mDataSetId;
std::string mFilePath; std::string mFilePath;
Mode mMode; Mode mMode;
bool mReleaseData;
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment