9#include "MantidKernel/DllConfig.h"
13#include <boost/optional.hpp>
40 void setFilePosition(uint64_t newPos,
size_t newSize,
bool wasSaved);
68 bool isBusy()
const {
return m_Busy; }
96 virtual void save()
const = 0;
155 void saveAt(uint64_t newPos, uint64_t newSize);
159 size_t setBufferPosition(std::list<ISaveable *>::iterator bufPosition);
162 boost::optional<std::list<ISaveable *>::iterator> &
getBufPostion() {
return m_BufPosition; }
170 void clearBufferState();
Buffer objects that need to be written out to disk so as to optimize writing operations.
An interface for objects that can be cached or saved to disk.
virtual ~ISaveable()=default
uint64_t m_fileIndexStart
Start point in the NXS file where the events are located.
void setDataChanged()
Call this method from the method which changes the object but keeps the object size the same to tell ...
void setBufferSize(size_t newSize)
virtual uint64_t getFilePosition() const
bool isDataChanged() const
virtual void load()=0
Load the data - to be overriden.
boost::optional< std::list< ISaveable * >::iterator > m_BufPosition
virtual void save() const =0
Save the data - to be overriden.
uint64_t m_fileNumEvents
Number of events saved in the file, after the start index location.
virtual void flushData() const =0
Method to flush the data to disk and ensure it is written.
boost::optional< std::list< ISaveable * >::iterator > & getBufPostion()
returns the iterator pointing to the position of this object within the memory to-write buffer
void setBusy(bool On)
@ set the data busy to prevent from removing them from memory.
uint64_t getFileSize() const
Return the number of units this block occipies on file.
bool m_Busy
a user needs to set this variable to true preventing from deleting data from buffer
void setLoaded(bool Yes)
sets the value of the isLoad parameter, indicating that data from HDD have its image in memory
virtual void clearDataFromMemory()=0
remove objects data from memory
void clearDataChanged()
this method has to be called if the object has been discarded from memory and is not changed any more...
bool m_dataChanged
a user needs to set this variable to true to allow DiskBuffer saving the object to HDD when it decide...
virtual uint64_t getTotalDataSize() const =0
bool m_isLoaded
this boolean indicates, if the data have its copy in memory
size_t getBufferSize() const
return the amount of memory, this object had when it was stored in buffer last time;
bool m_wasSaved
this boolean indicates if the data were saved on HDD and have physical representation on it (though t...
virtual size_t getDataMemorySize() const =0
the data size kept in memory
Helper class which provides the Collimation Length for SANS instruments.