Commit 18b3ccfe authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Remove getLastWrittenDataSet from HDF5Writer and just get that...

ENH: Remove getLastWrittenDataSet from HDF5Writer and just get that information from the appropriate HDF5Controller attached to the Array.
parent 95c92a3b
......@@ -16,7 +16,6 @@ public:
XdmfHDF5WriterImpl(const std::string & hdf5FilePath) :
mFilePath(hdf5FilePath),
mLastWrittenDataSet(""),
mDataSetId(0),
mMode(Default)
{
......@@ -26,7 +25,6 @@ public:
};
int mDataSetId;
std::string mFilePath;
std::string mLastWrittenDataSet;
Mode mMode;
};
......@@ -112,11 +110,6 @@ std::string XdmfHDF5Writer::getFilePath() const
return mImpl->mFilePath;
}
std::string XdmfHDF5Writer::getLastWrittenDataSet() const
{
return mImpl->mLastWrittenDataSet;
}
XdmfHDF5Writer::Mode XdmfHDF5Writer::getMode() const
{
return mImpl->mMode;
......@@ -130,7 +123,6 @@ void XdmfHDF5Writer::setMode(const Mode mode)
void XdmfHDF5Writer::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVisitor> visitor)
{
hid_t datatype = -1;
mImpl->mLastWrittenDataSet = "";
if(array.mHaveArray)
{
......@@ -140,10 +132,6 @@ void XdmfHDF5Writer::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVi
{
datatype = boost::apply_visitor(GetHDF5Type(), array.mArrayPointer);
}
else if(array.mHDF5Controller)
{
mImpl->mLastWrittenDataSet = array.mHDF5Controller->getDataSetPath();
}
if(datatype != -1)
{
......@@ -238,8 +226,6 @@ void XdmfHDF5Writer::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVi
std::stringstream writtenDataSet;
writtenDataSet << hdf5FilePath << ":" << dataSetName.str();
mImpl->mLastWrittenDataSet = writtenDataSet.str();
// Attach a new controller to the array if needed.
if(mImpl->mMode == Default || !array.mHDF5Controller)
{
......
......@@ -52,13 +52,6 @@ public:
*/
std::string getFilePath() const;
/**
* Get the path to the last written data set written by this writer.
*
* @return the path to the last written data set.
*/
std::string getLastWrittenDataSet() const;
/**
* Get the Mode of operation for this writer.
*
......
......@@ -138,8 +138,7 @@ void XdmfWriter::visit(XdmfArray & array, const boost::shared_ptr<XdmfBaseVisito
if(array.getHDF5Controller() || array.getSize() > mImpl->mLightDataLimit)
{
mImpl->mHDF5Writer->visit(array, mImpl->mHDF5Writer);
std::string contentVal = mImpl->mHDF5Writer->getLastWrittenDataSet();
std::cout << contentVal << std::endl;
std::string contentVal = array.getHDF5Controller()->getDataSetPath();
if(size_t colonLocation = contentVal.find(":") != std::string::npos)
{
if(size_t fileDir = contentVal.substr(0, colonLocation).find_last_of("/\\") != std::string::npos)
......
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