- Main Page
- Modules
- Classes
- Namespaces
- Files
- Related Pages

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
List of all members | Public Member Functions
SmartDigraph::Snapshot Class Reference

## Detailed Description

Class to make a snapshot of the digraph and to restore it later.

The newly added nodes and arcs can be removed using the restore() function. This is the only way for deleting nodes and/or arcs from a SmartDigraph structure.

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 splitting cannot be restored.
  The validity of the snapshot is not stored due to performance reasons. If you do not use the snapshot correctly, it can cause broken program, invalid or not restored state of the digraph or no change.

`#include <lemon/smart_graph.h>`

## Public Member Functions
| Snapshot ()
| Default constructor. More...
| Snapshot (SmartDigraph &gr)
| Constructor that immediately makes a snapshot. More...
void | save (SmartDigraph &gr)
| Make a snapshot. More...
void | restore ()
| Undo the changes until a snapshot. More...

## Constructor & Destructor Documentation

Snapshot | ( |  | ) |
| inline

Default constructor. You have to call save() to actually make a snapshot.

Snapshot | ( | SmartDigraph & | gr | ) |
| inline

This constructor immediately makes a snapshot of the given digraph.

## Member Function Documentation

void save | ( | SmartDigraph & | gr | ) |
| inline

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.

void restore | ( |  | ) |
| inline

This function undos the changes until the last snapshot created by save() or Snapshot(SmartDigraph&).