Class to make a snapshot of the digraph and restore it later.
More...
#include <lemon/list_graph.h>
Class to make a snapshot of the digraph and restore it later.
The newly added nodes and arcs can be removed using the restore() function.
- Note
- After a state is restored, you cannot restore a later state, i.e. you cannot add the removed nodes and arcs again using another Snapshot instance.
- Warning
- Node and arc deletions and other modifications (e.g. reversing, contracting, splitting arcs or nodes) cannot be restored. These events invalidate the snapshot. However, the arcs and nodes that were added to the digraph after making the current snapshot can be removed without invalidating it.
◆ Snapshot() [1/2]
Default constructor. You have to call save() to actually make a snapshot.
◆ Snapshot() [2/2]
This constructor immediately makes a snapshot of the given digraph.
◆ save()
This function makes a snapshot of the given digraph. It can be called more than once. In case of a repeated call, the previous snapshot gets lost.
◆ restore()
This function undos the changes until the last snapshot created by save() or Snapshot(ListDigraph&).
- Warning
- This method invalidates the snapshot, i.e. repeated restoring is not supported unless you call save() again.
◆ valid()
This function returns true if the snapshot is valid.