# HG changeset patch # User deba # Date 1131122454 0 # Node ID 9fd56d75293e3a2ef8d4fceedece50d12465bb81 # Parent ea5927cef15c977c488e120050d565bd71b0b937 UnsupportedException on erase with Snapshot diff -r ea5927cef15c -r 9fd56d75293e lemon/list_graph.h --- a/lemon/list_graph.h Fri Nov 04 16:35:18 2005 +0000 +++ b/lemon/list_graph.h Fri Nov 04 16:40:54 2005 +0000 @@ -30,6 +30,8 @@ #include +#include + #include namespace lemon { @@ -440,6 +442,16 @@ class Snapshot : protected AlterationNotifier::ObserverBase, protected AlterationNotifier::ObserverBase { + public: + + class UnsupportedOperation : public LogicError { + public: + virtual const char* exceptionName() const { + return "lemon::ListGraph::Snapshot::UnsupportedOperation"; + } + }; + + protected: ListGraph *g; @@ -450,20 +462,16 @@ virtual void add(const Node& n) { added_nodes.push_back(n); }; - ///\bug Exception... - /// virtual void erase(const Node&) { - exit(1); + throw UnsupportedOperation(); } virtual void add(const Edge& n) { added_edges.push_back(n); }; - ///\bug Exception... - /// virtual void erase(const Edge&) { - exit(1); + throw UnsupportedOperation(); } ///\bug What is this used for? @@ -488,7 +496,7 @@ detach(); g=0; } - + public: ///Default constructur.