Mantid
|
Two classes responsible for implementing methods which automatically save/load MDBox in conjuction with DiskBuffer One class responsible for saving events into nexus and another one – for identifying the data positions in a file in conjuction with DB. More...
#include <MDBoxSaveable.h>
Public Member Functions | |
void | clearDataFromMemory () override |
remove objects data from memory but keep all averages More... | |
void | flushData () const override |
Method to flush the data to disk and ensure it is written. More... | |
size_t | getDataMemorySize () const override |
uint64_t | getTotalDataSize () const override |
void | load () override |
Load the data which are not in memory yet and merge them with the data in memory;. More... | |
MDBoxSaveable (API::IMDNode *const) | |
void | save () const override |
Save the data to the place, specified by the object. More... | |
Public Member Functions inherited from Mantid::Kernel::ISaveable | |
void | clearDataChanged () |
this method has to be called if the object has been discarded from memory and is not changed any more. More... | |
virtual void | clearDataFromMemory ()=0 |
remove objects data from memory More... | |
virtual void | flushData () const =0 |
Method to flush the data to disk and ensure it is written. More... | |
virtual size_t | getDataMemorySize () const =0 |
the data size kept in memory More... | |
virtual uint64_t | getFilePosition () const |
uint64_t | getFileSize () const |
Return the number of units this block occipies on file. More... | |
virtual uint64_t | getTotalDataSize () const =0 |
ISaveable () | |
Constructor More... | |
ISaveable (const ISaveable &other) | |
Copy constructor --> needed for std containers and not to copy mutexes Note setting isLoaded to false to break connection with the file object which is not copyale. More... | |
bool | isBusy () const |
bool | isDataChanged () const |
bool | isLoaded () const |
virtual void | load ()=0 |
Load the data - to be overriden. More... | |
virtual void | save () const =0 |
Save the data - to be overriden. More... | |
void | setBusy (bool On) |
@ set the data busy to prevent from removing them from memory. More... | |
void | setDataChanged () |
Call this method from the method which changes the object but keeps the object size the same to tell DiskBuffer to write it back the dataChanged ID is reset after save from the DataBuffer is emptied More... | |
void | setFilePosition (uint64_t newPos, size_t newSize, bool wasSaved) |
Sets the location of the object on HDD. More... | |
void | setLoaded (bool Yes) |
sets the value of the isLoad parameter, indicating that data from HDD have its image in memory More... | |
bool | wasSaved () const |
virtual | ~ISaveable ()=default |
Private Attributes | |
API::IMDNode *const | m_MDNode |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::Kernel::ISaveable | |
bool | m_Busy |
a user needs to set this variable to true preventing from deleting data from buffer More... | |
bool | m_dataChanged |
a user needs to set this variable to true to allow DiskBuffer saving the object to HDD when it decides it suitable, if the size of iSavable object in cache is unchanged from the previous save/load operation More... | |
bool | m_isLoaded |
this boolean indicates, if the data have its copy in memory More... | |
bool | m_wasSaved |
this boolean indicates if the data were saved on HDD and have physical representation on it (though this representation may be incorrect as data changed in memory) More... | |
Two classes responsible for implementing methods which automatically save/load MDBox in conjuction with DiskBuffer One class responsible for saving events into nexus and another one – for identifying the data positions in a file in conjuction with DB.
Definition at line 25 of file MDBoxSaveable.h.
Mantid::DataObjects::MDBoxSaveable::MDBoxSaveable | ( | API::IMDNode * const | Host | ) |
Definition at line 12 of file MDBoxSaveable.cpp.
|
inlineoverridevirtual |
remove objects data from memory but keep all averages
Implements Mantid::Kernel::ISaveable.
Definition at line 38 of file MDBoxSaveable.h.
|
overridevirtual |
Method to flush the data to disk and ensure it is written.
flush data out of the file buffer to the HDD
Implements Mantid::Kernel::ISaveable.
Definition at line 15 of file MDBoxSaveable.cpp.
References Mantid::API::IBoxControllerIO::flushData(), Mantid::API::IMDNode::getBoxController(), Mantid::API::BoxController::getFileIO(), and m_MDNode.
|
inlineoverridevirtual |
Implements Mantid::Kernel::ISaveable.
Definition at line 46 of file MDBoxSaveable.h.
|
inlineoverridevirtual |
Implements Mantid::Kernel::ISaveable.
Definition at line 41 of file MDBoxSaveable.h.
|
overridevirtual |
Load the data which are not in memory yet and merge them with the data in memory;.
Loads the data from HDD if these data has not been loaded before.
private function called from the DiskBuffer
Implements Mantid::Kernel::ISaveable.
Definition at line 37 of file MDBoxSaveable.cpp.
References Mantid::API::IMDNode::getBoxController(), Mantid::API::BoxController::getFileIO(), Mantid::Kernel::ISaveable::getFilePosition(), Mantid::Kernel::ISaveable::getFileSize(), Mantid::API::IMDNode::loadAndAddFrom(), Mantid::Kernel::ISaveable::m_isLoaded, m_MDNode, and Mantid::Kernel::ISaveable::setLoaded().
Referenced by save().
|
overridevirtual |
Save the data to the place, specified by the object.
Physically save the box data.
Tries to load any previous data from HDD Private function called from the DiskBuffer.
Save the box at the disk position defined by this class. The IMDNode has to be file backed for this method to work
Implements Mantid::Kernel::ISaveable.
Definition at line 21 of file MDBoxSaveable.cpp.
References Mantid::API::IMDNode::getBoxController(), Mantid::API::BoxController::getFileIO(), Mantid::Kernel::ISaveable::getFilePosition(), load(), m_MDNode, Mantid::Kernel::ISaveable::m_wasSaved, Mantid::API::IMDNode::saveAt(), and Mantid::Kernel::ISaveable::wasSaved().
|
private |
Definition at line 49 of file MDBoxSaveable.h.
Referenced by flushData(), load(), and save().