Public Member Functions

SmartDigraph::Snapshot Class Reference


Detailed Description

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

The newly added nodes and arcs can be removed using the restore() function.

Note:
After you restore a state, you cannot restore a later state, in other word you cannot add again the arcs deleted by restore() using another one Snapshot instance.
Warning:
If you do not use correctly the snapshot that can cause either broken program, invalid state of the digraph, valid but not the restored digraph or no change. Because the runtime performance the validity of the snapshot is not stored.

#include <lemon/smart_graph.h>

List of all members.

Public Member Functions

 Snapshot ()
 Default constructor.
 Snapshot (SmartDigraph &graph)
 Constructor that immediately makes a snapshot.
void save (SmartDigraph &graph)
 Make a snapshot.
void restore ()
 Undo the changes until a snapshot.

Constructor & Destructor Documentation

Snapshot ( ) [inline]

Default constructor. To actually make a snapshot you must call save().

Snapshot ( SmartDigraph graph) [inline]

This constructor immediately makes a snapshot of the digraph.

Parameters:
graphThe digraph we make a snapshot of.

Member Function Documentation

void save ( SmartDigraph graph) [inline]

Make a snapshot of the digraph.

This function can be called more than once. In case of a repeated call, the previous snapshot gets lost.

Parameters:
graphThe digraph we make the snapshot of.
void restore ( ) [inline]

Undo the changes until a snapshot created by save().

Note:
After you restored a state, you cannot restore a later state, in other word you cannot add again the arcs deleted by restore().
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines