ImFusion SDK 4.3
UndoSerializer Class Reference

#include <ImFusion/Seg/UndoRecorder.h>

Serializes undo levels into (binary) files and restores the whole stack of undos from these files writeUndoFile() can be repeatedly called asynchronously, restoreUndoStack() should be called once. More...

Detailed Description

Serializes undo levels into (binary) files and restores the whole stack of undos from these files writeUndoFile() can be repeatedly called asynchronously, restoreUndoStack() should be called once.

Public Member Functions

 UndoSerializer (const std::string &undoDir)
 
std::vector< internal::UndoLevelrestoreUndoStack (bool deleteUnrestoredFiles=true)
 Restores the full undo stack reading from the directory passed in the constructor.
 
void writeUndoFileAsync (internal::UndoLevel uLevel)
 Starts writing the given undo to a binary file in the background and return immediately.
 
void waitUntilWriterFinished ()
 Waits until all async writers are finished (see writeUndoFileAsync).
 

Protected Member Functions

std::optional< internal::UndoLevelreadIn (std::istream &is)
 

Static Protected Member Functions

static void writeOut (std::ostream &os, const internal::UndoLevel &uLevel)
 Methods to serialize and deserialize an UndoLevel to ostream/istream.
 

Member Function Documentation

◆ writeUndoFileAsync()

void writeUndoFileAsync ( internal::UndoLevel uLevel)

Starts writing the given undo to a binary file in the background and return immediately.

Only one file is written at a time. When calling this function multiple times, the next file is only written once the previous files have been completely written.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close