Skip to content

Commit

Permalink
refs #6449 removed traces of Saveable
Browse files Browse the repository at this point in the history
and * const attribute from getISaveable
  • Loading branch information
abuts committed Apr 9, 2013
1 parent a76ab61 commit dfb8018
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 36 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class IMDNode
virtual ~IMDNode(){};
//---------------- ISAVABLE
/**Return the pointer to the structure responsible for saving the box on disk if the workspace occupies too much memory */
virtual Kernel::ISaveable *const getISaveable()=0;
virtual Kernel::ISaveable * getISaveable()=0;
/**Return the pointer to the sconst tructure responsible for saving the box on disk if the workspace occupies too much memory */
virtual Kernel::ISaveable *const getISaveable()const=0;
virtual Kernel::ISaveable * getISaveable()const=0;
/** initiate the structure responsible for swapping the box on HDD if out of memory. */
virtual void setFileBacked(const uint64_t /*fileLocation*/,const size_t /*fileSize*/, const bool /*markSaved*/)=0;
/** initiate the structure responsible for swapping the box on HDD if out of memory with default parameters (it does not know its place on HDD and was not saved). */
Expand Down Expand Up @@ -94,8 +94,8 @@ class IMDNode


/// get box controller
virtual Mantid::API::BoxController *const getBoxController() const=0;
virtual Mantid::API::BoxController *const getBoxController() =0;
virtual Mantid::API::BoxController * getBoxController() const=0;
virtual Mantid::API::BoxController * getBoxController() =0;

// -------------------------------- Parents/Children-Related -------------------------------------------
/// Get the total # of unsplit MDBoxes contained.
Expand Down
35 changes: 15 additions & 20 deletions Code/Mantid/Framework/Kernel/test/DiskBufferISaveableTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,14 @@ using Mantid::Kernel::CPUTimer;
class ISaveableTester : public ISaveable
{
size_t id;
bool _isBusy;

public:
ISaveableTester(size_t idIn) : ISaveable(),
id(idIn),
_isBusy(false)
id(idIn)
{}
virtual ~ISaveableTester(){}
size_t getFileId()const{return id;}
// temporary functions
virtual bool isBusy()const{return _isBusy;}
virtual bool isDataChanged()const{return true;}
virtual bool wasSaved()const{return false;}
virtual void setLoaded(bool ){};
virtual bool isLoaded()const{return true;}
virtual void setBusy(bool On=true){_isBusy=On;}
virtual void setDataChanged(){}
virtual void clearDataChanged(){}
virtual void setFilePosition(uint64_t,size_t, bool)
{}
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------

/// Save the data - to be overriden
virtual void save()const
Expand All @@ -56,16 +44,23 @@ class ISaveableTester : public ISaveable
streamMutex.lock();
fakeFile += out.str();
streamMutex.unlock();
this->m_wasSaved=true;
}


/// Load the data - to be overriden
virtual void load(){};
virtual void load()
{
this->setLoaded(true);
};

/// Method to flush the data to disk and ensure it is written.
virtual void flushData() const{};
/// remove objects data from memory
virtual void clearDataFromMemory(){};
virtual void clearDataFromMemory()
{
this->setLoaded(false);
};

/** @return the amount of memory that the object takes as a whole.
For filebased objects it should be the amount the object occupies in memory plus the size it occupies in file if the object has not been fully loaded
Expand Down Expand Up @@ -271,7 +266,7 @@ class DiskBufferISaveableTest : public CxxTest::TestSuite
DiskBuffer dbuf(4);
for (size_t i=0; i<9; i++)
{
data[i]->setBusy();
data[i]->setBusy(true);
dbuf.toWrite(data[i]);
}
// We ended up with too much in the buffer since nothing could be written.
Expand Down Expand Up @@ -453,7 +448,7 @@ class DiskBufferISaveableTestPerformance : public CxxTest::TestSuite
for (size_t i=0; i<num; i++)
{
data.push_back( new ISaveableTester(i) );
data[i]->setBusy(); // Items won't do any real saving
data[i]->setBusy(true); // Items won't do any real saving
}
}
void setUp()
Expand Down Expand Up @@ -481,7 +476,7 @@ class DiskBufferISaveableTestPerformance : public CxxTest::TestSuite
DiskBuffer dbuf(0);
for (size_t i=0; i<data.size(); i++)
{
data[i]->setBusy(); // Items won't do any real saving
data[i]->setBusy(true); // Items won't do any real saving
}

for (int i=0; i<int(data.size()); i++)
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ namespace MDEvents


// ----------------------------- ISaveable Methods ------------------------------------------------------
virtual Kernel::ISaveable *const getISaveable();
virtual Kernel::ISaveable *const getISaveable()const;
virtual Kernel::ISaveable * getISaveable();
virtual Kernel::ISaveable * getISaveable()const;
virtual void setFileBacked(const uint64_t /*fileLocation*/,const size_t /*fileSize*/, const bool /*markSaved*/);
virtual void setFileBacked();
virtual void clearFileBacked(bool loadDiskBackedData);
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDBoxBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ namespace MDEvents

// -------------------------------------------------------------------------------------------
/// @return the const box controller for this box.
Mantid::API::BoxController *const getBoxController() const
Mantid::API::BoxController * getBoxController() const
{ return m_BoxController; }
/// @return the box controller for this box.
virtual Mantid::API::BoxController *const getBoxController()
virtual Mantid::API::BoxController * getBoxController()
{ return m_BoxController; }


Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDGridBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ namespace MDEvents
// ----------------------------- ISaveable Methods ------------------------------------------------------
/**get object responsible for saving the box to a file.
*@return the const pointer to the object. The GridBox is not saveable at the moment so it is always NULL */
virtual Kernel::ISaveable *const getISaveable(){return NULL;}
virtual Kernel::ISaveable * getISaveable(){return NULL;}
/**get const object responsible for saving the box to a file.
*@return the const pointer the const object. The GridBox is not saveable at the moment so it is always NULL */
virtual Kernel::ISaveable *const getISaveable()const{return NULL;}
virtual Kernel::ISaveable * getISaveable()const{return NULL;}
/**Recursively make all underlaying boxes file-backed*/
virtual void setFileBacked(const uint64_t /*fileLocation*/,const size_t /*fileSize*/, const bool /*markSaved*/);
virtual void setFileBacked();
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/src/MDBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ namespace MDEvents
}

TMDE(
Kernel::ISaveable *const MDBox)::getISaveable()
Kernel::ISaveable * MDBox)::getISaveable()
{
return m_Saveable;
}
TMDE(
Kernel::ISaveable *const MDBox)::getISaveable()const
Kernel::ISaveable * MDBox)::getISaveable()const
{
return m_Saveable;
}
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/src/MDBoxSaveable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace MDEvents
if (!m_isLoaded)
{
API::IBoxControllerIO *fileIO = m_MDNode->getBoxController()->getFileIO();
m_MDNode->loadAndAddFrom(fileIO,this->m_fileIndexStart,this->m_fileNumEvents);
this->m_isLoaded = true;
m_MDNode->loadAndAddFrom(fileIO,this->getFilePosition(),this->getFileSize());
this->setLoaded(true);
}

}
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/test/MDBoxBaseTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class MDBoxBaseTester : public MDBoxBase<MDE,nd>
{
}
//-----------------------------------------------------------------------------------------------
Kernel::ISaveable *const getISaveable(){return NULL;}
Kernel::ISaveable *const getISaveable()const{return NULL;}
Kernel::ISaveable * getISaveable(){return NULL;}
Kernel::ISaveable * getISaveable()const{return NULL;}
void setFileBacked(const uint64_t /*fileLocation*/,const size_t /*fileSize*/, const bool /*markSaved*/){};
void clearFileBacked(bool /* loadData*/){/**does nothing*/};
void setFileBacked(){};
Expand Down

0 comments on commit dfb8018

Please sign in to comment.