[Lemon-commits] [lemon_svn] deba: r2918 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 21:51:14 CET 2006
Author: deba
Date: Mon Sep 4 14:27:03 2006
New Revision: 2918
Modified:
hugo/trunk/lemon/edge_set.h
Log:
Bug fix in SmartEdgeSet
+ validity check function
Modified: hugo/trunk/lemon/edge_set.h
==============================================================================
--- hugo/trunk/lemon/edge_set.h (original)
+++ hugo/trunk/lemon/edge_set.h Mon Sep 4 14:27:03 2006
@@ -584,15 +584,6 @@
typedef _Graph Graph;
- class UnsupportedOperation : public LogicError {
- public:
- virtual const char* what() const throw() {
- return "lemon::SmartEdgeSet::UnsupportedOperation";
- }
- };
-
-
-
protected:
typedef typename Parent::NodesImplBase NodesImplBase;
@@ -618,6 +609,10 @@
virtual ~NodesImpl() {}
+ bool attached() const {
+ return Parent::attached();
+ }
+
protected:
virtual void erase(const Node& node) {
@@ -626,6 +621,7 @@
Parent::erase(node);
} catch (const typename NodesImplBase::Notifier::ImmediateDetach&) {
Parent::clear();
+ throw;
}
}
virtual void erase(const std::vector<Node>& nodes) {
@@ -636,6 +632,7 @@
Parent::erase(nodes);
} catch (const typename NodesImplBase::Notifier::ImmediateDetach&) {
Parent::clear();
+ throw;
}
}
virtual void clear() {
@@ -657,6 +654,10 @@
SmartEdgeSet(const Graph& graph) : nodes(graph, *this) {
Parent::initalize(graph, nodes);
}
+
+ bool valid() const {
+ return nodes.attached();
+ }
};
@@ -712,6 +713,10 @@
: Parent(graph), _edgeset(edgeset) {}
virtual ~NodesImpl() {}
+
+ bool attached() const {
+ return Parent::attached();
+ }
protected:
@@ -754,6 +759,10 @@
SmartUEdgeSet(const Graph& graph) : nodes(graph, *this) {
Parent::initalize(graph, nodes);
}
+
+ bool valid() const {
+ return nodes.attached();
+ }
};
More information about the Lemon-commits
mailing list