Class to make a snapshot of the graph and restore it later.
The newly added nodes and edges can be removed using the restore() function.
#include <lemon/list_graph.h>
Public Member Functions | |
Snapshot () | |
Default constructor. | |
Snapshot (ListGraph &gr) | |
Constructor that immediately makes a snapshot. | |
void | save (ListGraph &gr) |
Make a snapshot. | |
void | restore () |
Undo the changes until the last snapshot. | |
bool | valid () const |
Returns true if the snapshot is valid. |
This constructor immediately makes a snapshot of the given graph.
void save | ( | ListGraph & | gr | ) | [inline] |
This function makes a snapshot of the given graph. It can be called more than once. In case of a repeated call, the previous snapshot gets lost.
void restore | ( | ) | [inline] |
This function undos the changes until the last snapshot created by save() or Snapshot(ListGraph&).
bool valid | ( | ) | const [inline] |
This function returns true
if the snapshot is valid.