14 : m_Busy(false), m_dataChanged(false), m_wasSaved(false), m_isLoaded(false), m_BufMemorySize(0),
15 m_fileIndexStart(
std::numeric_limits<uint64_t>::max()), m_fileNumEvents(0) {}
22 : m_Busy(other.m_Busy), m_dataChanged(other.m_dataChanged), m_wasSaved(other.m_wasSaved), m_isLoaded(false),
23 m_BufPosition(other.m_BufPosition), m_BufMemorySize(other.m_BufMemorySize),
24 m_fileIndexStart(other.m_fileIndexStart), m_fileNumEvents(other.m_fileNumEvents)
36 std::lock_guard<std::mutex> lock(
m_setter);
50 std::lock_guard<std::mutex> lock(
m_setter);
70 std::lock_guard<std::mutex> lock(
m_setter);
71 m_BufPosition = boost::optional<std::list<ISaveable *>::iterator>(bufPosition);
80 std::lock_guard<std::mutex> lock(
m_setter);
83 m_BufPosition = boost::optional<std::list<ISaveable *>::iterator>();
An interface for objects that can be cached or saved to disk.
void clearBufferState()
clears the state of the object, and indicate that it is not stored in buffer any more
uint64_t m_fileIndexStart
Start point in the NXS file where the events are located.
virtual void load()=0
Load the data - to be overriden.
boost::optional< std::list< ISaveable * >::iterator > m_BufPosition
size_t setBufferPosition(std::list< ISaveable * >::iterator bufPosition)
sets the iterator pointing to the location of this object in the memory buffer to write later
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.
void saveAt(uint64_t newPos, uint64_t newSize)
save at specific file location the specific amount of data; used by DiskBuffer which asks this object...
virtual void clearDataFromMemory()=0
remove objects data from memory
void setFilePosition(uint64_t newPos, size_t newSize, bool wasSaved)
Sets the location of the object on HDD.
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