Traits for alteration notifiers
authordeba
Wed, 01 Mar 2006 10:04:47 +0000
changeset 1989d276e88aa48a
parent 1988 875fe3f689e0
child 1990 15fb7a4ea6be
Traits for alteration notifiers
SplitGraph is temporarly deleted
lemon/bits/alteration_notifier.h
lemon/graph_adaptor.h
lemon/traits.h
lemon/utility.h
     1.1 --- a/lemon/bits/alteration_notifier.h	Wed Mar 01 09:40:16 2006 +0000
     1.2 +++ b/lemon/bits/alteration_notifier.h	Wed Mar 01 10:04:47 2006 +0000
     1.3 @@ -16,8 +16,8 @@
     1.4   *
     1.5   */
     1.6  
     1.7 -#ifndef LEMON_ALTERATION_OBSERVER_REGISTRY_H
     1.8 -#define LEMON_ALTERATION_OBSERVER_REGISTRY_H
     1.9 +#ifndef LEMON_ALTERATION_NOTIFIER_H
    1.10 +#define LEMON_ALTERATION_NOTIFIER_H
    1.11  
    1.12  #include <vector>
    1.13  #include <algorithm>
    1.14 @@ -28,7 +28,7 @@
    1.15  
    1.16  namespace lemon {
    1.17  
    1.18 -  /// \addtogroin graphmapfactory
    1.19 +  /// \addtogroup graphmapfactory
    1.20    /// @{
    1.21  
    1.22    /// \brief Registry class to register objects observes alterations in 
    1.23 @@ -51,6 +51,9 @@
    1.24    template <typename _Item>
    1.25    class AlterationNotifier {
    1.26    public:
    1.27 +
    1.28 +    typedef True Notifier;
    1.29 +
    1.30      typedef _Item Item;
    1.31  
    1.32      /// ObserverBase is the base class for the observers.
     2.1 --- a/lemon/graph_adaptor.h	Wed Mar 01 09:40:16 2006 +0000
     2.2 +++ b/lemon/graph_adaptor.h	Wed Mar 01 10:04:47 2006 +0000
     2.3 @@ -1350,372 +1350,371 @@
     2.4  
     2.5    };
     2.6  
     2.7 -  template <typename _Graph>
     2.8 -  class SplitGraphAdaptorBase 
     2.9 -    : public GraphAdaptorBase<_Graph> {
    2.10 -  public:
    2.11 -    typedef GraphAdaptorBase<_Graph> Parent;
    2.12 +//   template <typename _Graph>
    2.13 +//   class SplitGraphAdaptorBase 
    2.14 +//     : public GraphAdaptorBase<_Graph> {
    2.15 +//   public:
    2.16 +//     typedef GraphAdaptorBase<_Graph> Parent;
    2.17  
    2.18 -    class Node;
    2.19 -    class Edge;
    2.20 -    template <typename T> class NodeMap;
    2.21 -    template <typename T> class EdgeMap;
    2.22 +//     class Node;
    2.23 +//     class Edge;
    2.24 +//     template <typename T> class NodeMap;
    2.25 +//     template <typename T> class EdgeMap;
    2.26      
    2.27  
    2.28 -    class Node : public Parent::Node {
    2.29 -      friend class SplitGraphAdaptorBase;
    2.30 -      template <typename T> friend class NodeMap;
    2.31 -      typedef typename Parent::Node NodeParent;
    2.32 -    private:
    2.33 +//     class Node : public Parent::Node {
    2.34 +//       friend class SplitGraphAdaptorBase;
    2.35 +//       template <typename T> friend class NodeMap;
    2.36 +//       typedef typename Parent::Node NodeParent;
    2.37 +//     private:
    2.38  
    2.39 -      bool entry;
    2.40 -      Node(typename Parent::Node _node, bool _entry)
    2.41 -	: Parent::Node(_node), entry(_entry) {}
    2.42 +//       bool entry;
    2.43 +//       Node(typename Parent::Node _node, bool _entry)
    2.44 +// 	: Parent::Node(_node), entry(_entry) {}
    2.45        
    2.46 -    public:
    2.47 -      Node() {}
    2.48 -      Node(Invalid) : NodeParent(INVALID), entry(true) {}
    2.49 +//     public:
    2.50 +//       Node() {}
    2.51 +//       Node(Invalid) : NodeParent(INVALID), entry(true) {}
    2.52  
    2.53 -      bool operator==(const Node& node) const {
    2.54 -	return NodeParent::operator==(node) && entry == node.entry;
    2.55 -      }
    2.56 +//       bool operator==(const Node& node) const {
    2.57 +// 	return NodeParent::operator==(node) && entry == node.entry;
    2.58 +//       }
    2.59        
    2.60 -      bool operator!=(const Node& node) const {
    2.61 -	return !(*this == node);
    2.62 -      }
    2.63 +//       bool operator!=(const Node& node) const {
    2.64 +// 	return !(*this == node);
    2.65 +//       }
    2.66        
    2.67 -      bool operator<(const Node& node) const {
    2.68 -	return NodeParent::operator<(node) || 
    2.69 -	  (NodeParent::operator==(node) && entry < node.entry);
    2.70 -      }
    2.71 -    };
    2.72 +//       bool operator<(const Node& node) const {
    2.73 +// 	return NodeParent::operator<(node) || 
    2.74 +// 	  (NodeParent::operator==(node) && entry < node.entry);
    2.75 +//       }
    2.76 +//     };
    2.77  
    2.78 -    /// \todo May we want VARIANT/union type
    2.79 -    class Edge : public Parent::Edge {
    2.80 -      friend class SplitGraphAdaptorBase;
    2.81 -      template <typename T> friend class EdgeMap;
    2.82 -    private:
    2.83 -      typedef typename Parent::Edge EdgeParent;
    2.84 -      typedef typename Parent::Node NodeParent;
    2.85 -      NodeParent bind;
    2.86 +//     /// \todo May we want VARIANT/union type
    2.87 +//     class Edge : public Parent::Edge {
    2.88 +//       friend class SplitGraphAdaptorBase;
    2.89 +//       template <typename T> friend class EdgeMap;
    2.90 +//     private:
    2.91 +//       typedef typename Parent::Edge EdgeParent;
    2.92 +//       typedef typename Parent::Node NodeParent;
    2.93 +//       NodeParent bind;
    2.94  
    2.95 -      Edge(const EdgeParent& edge, const NodeParent& node)
    2.96 -	: EdgeParent(edge), bind(node) {}
    2.97 -    public:
    2.98 -      Edge() {}
    2.99 -      Edge(Invalid) : EdgeParent(INVALID), bind(INVALID) {}
   2.100 +//       Edge(const EdgeParent& edge, const NodeParent& node)
   2.101 +// 	: EdgeParent(edge), bind(node) {}
   2.102 +//     public:
   2.103 +//       Edge() {}
   2.104 +//       Edge(Invalid) : EdgeParent(INVALID), bind(INVALID) {}
   2.105  
   2.106 -      bool operator==(const Edge& edge) const {
   2.107 -	return EdgeParent::operator==(edge) && bind == edge.bind;
   2.108 -      }
   2.109 +//       bool operator==(const Edge& edge) const {
   2.110 +// 	return EdgeParent::operator==(edge) && bind == edge.bind;
   2.111 +//       }
   2.112        
   2.113 -      bool operator!=(const Edge& edge) const {
   2.114 -	return !(*this == edge);
   2.115 -      }
   2.116 +//       bool operator!=(const Edge& edge) const {
   2.117 +// 	return !(*this == edge);
   2.118 +//       }
   2.119        
   2.120 -      bool operator<(const Edge& edge) const {
   2.121 -	return EdgeParent::operator<(edge) || 
   2.122 -	  (EdgeParent::operator==(edge) && bind < edge.bind);
   2.123 -      }
   2.124 -    };
   2.125 +//       bool operator<(const Edge& edge) const {
   2.126 +// 	return EdgeParent::operator<(edge) || 
   2.127 +// 	  (EdgeParent::operator==(edge) && bind < edge.bind);
   2.128 +//       }
   2.129 +//     };
   2.130  
   2.131 -    void first(Node& node) const {
   2.132 -      Parent::first(node);
   2.133 -      node.entry = true;
   2.134 -    } 
   2.135 +//     void first(Node& node) const {
   2.136 +//       Parent::first(node);
   2.137 +//       node.entry = true;
   2.138 +//     } 
   2.139  
   2.140 -    void next(Node& node) const {
   2.141 -      if (node.entry) {
   2.142 -	node.entry = false;
   2.143 -      } else {
   2.144 -	node.entry = true;
   2.145 -	Parent::next(node);
   2.146 -      }
   2.147 -    }
   2.148 +//     void next(Node& node) const {
   2.149 +//       if (node.entry) {
   2.150 +// 	node.entry = false;
   2.151 +//       } else {
   2.152 +// 	node.entry = true;
   2.153 +// 	Parent::next(node);
   2.154 +//       }
   2.155 +//     }
   2.156  
   2.157 -    void first(Edge& edge) const {
   2.158 -      Parent::first(edge);
   2.159 -      if ((typename Parent::Edge&)edge == INVALID) {
   2.160 -	Parent::first(edge.bind);
   2.161 -      } else {
   2.162 -	edge.bind = INVALID;
   2.163 -      }
   2.164 -    }
   2.165 +//     void first(Edge& edge) const {
   2.166 +//       Parent::first(edge);
   2.167 +//       if ((typename Parent::Edge&)edge == INVALID) {
   2.168 +// 	Parent::first(edge.bind);
   2.169 +//       } else {
   2.170 +// 	edge.bind = INVALID;
   2.171 +//       }
   2.172 +//     }
   2.173  
   2.174 -    void next(Edge& edge) const {
   2.175 -      if ((typename Parent::Edge&)edge != INVALID) {
   2.176 -	Parent::next(edge);
   2.177 -	if ((typename Parent::Edge&)edge == INVALID) {
   2.178 -	  Parent::first(edge.bind);
   2.179 -	}
   2.180 -      } else {
   2.181 -	Parent::next(edge.bind);
   2.182 -      }      
   2.183 -    }
   2.184 +//     void next(Edge& edge) const {
   2.185 +//       if ((typename Parent::Edge&)edge != INVALID) {
   2.186 +// 	Parent::next(edge);
   2.187 +// 	if ((typename Parent::Edge&)edge == INVALID) {
   2.188 +// 	  Parent::first(edge.bind);
   2.189 +// 	}
   2.190 +//       } else {
   2.191 +// 	Parent::next(edge.bind);
   2.192 +//       }      
   2.193 +//     }
   2.194  
   2.195 -    void firstIn(Edge& edge, const Node& node) const {
   2.196 -      if (node.entry) {
   2.197 -	Parent::firstIn(edge, node);
   2.198 -	edge.bind = INVALID;
   2.199 -      } else {
   2.200 -	(typename Parent::Edge&)edge = INVALID;
   2.201 -	edge.bind = node;
   2.202 -      }
   2.203 -    }
   2.204 +//     void firstIn(Edge& edge, const Node& node) const {
   2.205 +//       if (node.entry) {
   2.206 +// 	Parent::firstIn(edge, node);
   2.207 +// 	edge.bind = INVALID;
   2.208 +//       } else {
   2.209 +// 	(typename Parent::Edge&)edge = INVALID;
   2.210 +// 	edge.bind = node;
   2.211 +//       }
   2.212 +//     }
   2.213  
   2.214 -    void nextIn(Edge& edge) const {
   2.215 -      if ((typename Parent::Edge&)edge != INVALID) {
   2.216 -	Parent::nextIn(edge);
   2.217 -      } else {
   2.218 -	edge.bind = INVALID;
   2.219 -      }      
   2.220 -    }
   2.221 +//     void nextIn(Edge& edge) const {
   2.222 +//       if ((typename Parent::Edge&)edge != INVALID) {
   2.223 +// 	Parent::nextIn(edge);
   2.224 +//       } else {
   2.225 +// 	edge.bind = INVALID;
   2.226 +//       }      
   2.227 +//     }
   2.228  
   2.229 -    void firstOut(Edge& edge, const Node& node) const {
   2.230 -      if (!node.entry) {
   2.231 -	Parent::firstOut(edge, node);
   2.232 -	edge.bind = INVALID;
   2.233 -      } else {
   2.234 -	(typename Parent::Edge&)edge = INVALID;
   2.235 -	edge.bind = node;
   2.236 -      }
   2.237 -    }
   2.238 +//     void firstOut(Edge& edge, const Node& node) const {
   2.239 +//       if (!node.entry) {
   2.240 +// 	Parent::firstOut(edge, node);
   2.241 +// 	edge.bind = INVALID;
   2.242 +//       } else {
   2.243 +// 	(typename Parent::Edge&)edge = INVALID;
   2.244 +// 	edge.bind = node;
   2.245 +//       }
   2.246 +//     }
   2.247  
   2.248 -    void nextOut(Edge& edge) const {
   2.249 -      if ((typename Parent::Edge&)edge != INVALID) {
   2.250 -	Parent::nextOut(edge);
   2.251 -      } else {
   2.252 -	edge.bind = INVALID;
   2.253 -      }
   2.254 -    }
   2.255 +//     void nextOut(Edge& edge) const {
   2.256 +//       if ((typename Parent::Edge&)edge != INVALID) {
   2.257 +// 	Parent::nextOut(edge);
   2.258 +//       } else {
   2.259 +// 	edge.bind = INVALID;
   2.260 +//       }
   2.261 +//     }
   2.262  
   2.263 -    Node source(const Edge& edge) const {
   2.264 -      if ((typename Parent::Edge&)edge != INVALID) {
   2.265 -	return Node(Parent::source(edge), false);
   2.266 -      } else {
   2.267 -	return Node(edge.bind, true);
   2.268 -      }
   2.269 -    }
   2.270 +//     Node source(const Edge& edge) const {
   2.271 +//       if ((typename Parent::Edge&)edge != INVALID) {
   2.272 +// 	return Node(Parent::source(edge), false);
   2.273 +//       } else {
   2.274 +// 	return Node(edge.bind, true);
   2.275 +//       }
   2.276 +//     }
   2.277  
   2.278 -    Node target(const Edge& edge) const {
   2.279 -      if ((typename Parent::Edge&)edge != INVALID) {
   2.280 -	return Node(Parent::target(edge), true);
   2.281 -      } else {
   2.282 -	return Node(edge.bind, false);
   2.283 -      }
   2.284 -    }
   2.285 +//     Node target(const Edge& edge) const {
   2.286 +//       if ((typename Parent::Edge&)edge != INVALID) {
   2.287 +// 	return Node(Parent::target(edge), true);
   2.288 +//       } else {
   2.289 +// 	return Node(edge.bind, false);
   2.290 +//       }
   2.291 +//     }
   2.292  
   2.293 -    static bool entryNode(const Node& node) {
   2.294 -      return node.entry;
   2.295 -    }
   2.296 +//     static bool entryNode(const Node& node) {
   2.297 +//       return node.entry;
   2.298 +//     }
   2.299  
   2.300 -    static bool exitNode(const Node& node) {
   2.301 -      return !node.entry;
   2.302 -    }
   2.303 +//     static bool exitNode(const Node& node) {
   2.304 +//       return !node.entry;
   2.305 +//     }
   2.306  
   2.307 -    static Node getEntry(const typename Parent::Node& node) {
   2.308 -      return Node(node, true);
   2.309 -    }
   2.310 +//     static Node getEntry(const typename Parent::Node& node) {
   2.311 +//       return Node(node, true);
   2.312 +//     }
   2.313  
   2.314 -    static Node getExit(const typename Parent::Node& node) {
   2.315 -      return Node(node, false);
   2.316 -    }
   2.317 +//     static Node getExit(const typename Parent::Node& node) {
   2.318 +//       return Node(node, false);
   2.319 +//     }
   2.320  
   2.321 -    static bool originalEdge(const Edge& edge) {
   2.322 -      return (typename Parent::Edge&)edge != INVALID;
   2.323 -    }
   2.324 +//     static bool originalEdge(const Edge& edge) {
   2.325 +//       return (typename Parent::Edge&)edge != INVALID;
   2.326 +//     }
   2.327  
   2.328 -    static bool bindingEdge(const Edge& edge) {
   2.329 -      return edge.bind != INVALID;
   2.330 -    }
   2.331 +//     static bool bindingEdge(const Edge& edge) {
   2.332 +//       return edge.bind != INVALID;
   2.333 +//     }
   2.334  
   2.335 -    static Node getBindedNode(const Edge& edge) {
   2.336 -      return edge.bind;
   2.337 -    }
   2.338 +//     static Node getBindedNode(const Edge& edge) {
   2.339 +//       return edge.bind;
   2.340 +//     }
   2.341  
   2.342 -    int nodeNum() const {
   2.343 -      return Parent::nodeNum() * 2;
   2.344 -    }
   2.345 +//     int nodeNum() const {
   2.346 +//       return Parent::nodeNum() * 2;
   2.347 +//     }
   2.348  
   2.349 -    typedef CompileTimeAnd<typename Parent::NodeNumTag, 
   2.350 -    			   typename Parent::EdgeNumTag> EdgeNumTag;
   2.351 +//     typedef True EdgeNumTag;
   2.352      
   2.353 -    int edgeNum() const {
   2.354 -      return Parent::edgeNum() + Parent::nodeNum();
   2.355 -    }
   2.356 +//     int edgeNum() const {
   2.357 +//       return countEdges() + Parent::nodeNum();
   2.358 +//     }
   2.359  
   2.360 -    Edge findEdge(const Node& source, const Node& target, 
   2.361 -		  const Edge& prev = INVALID) const {
   2.362 -      if (exitNode(source) && entryNode(target)) {
   2.363 -	return Parent::findEdge(source, target, prev);
   2.364 -      } else {
   2.365 -	if (prev == INVALID && entryNode(source) && exitNode(target) && 
   2.366 -	    (typename Parent::Node&)source == (typename Parent::Node&)target) {
   2.367 -	  return Edge(INVALID, source);
   2.368 -	} else {
   2.369 -	  return INVALID;
   2.370 -	}
   2.371 -      }
   2.372 -    }
   2.373 +//     Edge findEdge(const Node& source, const Node& target, 
   2.374 +// 		  const Edge& prev = INVALID) const {
   2.375 +//       if (exitNode(source) && entryNode(target)) {
   2.376 +// 	return Parent::findEdge(source, target, prev);
   2.377 +//       } else {
   2.378 +// 	if (prev == INVALID && entryNode(source) && exitNode(target) && 
   2.379 +// 	    (typename Parent::Node&)source == (typename Parent::Node&)target) {
   2.380 +// 	  return Edge(INVALID, source);
   2.381 +// 	} else {
   2.382 +// 	  return INVALID;
   2.383 +// 	}
   2.384 +//       }
   2.385 +//     }
   2.386      
   2.387 -    template <typename T>
   2.388 -    class NodeMap : public MapBase<Node, T> {
   2.389 -      typedef typename Parent::template NodeMap<T> NodeImpl;
   2.390 -    public:
   2.391 -      NodeMap(const SplitGraphAdaptorBase& _graph) 
   2.392 -	: entry(_graph), exit(_graph) {}
   2.393 -      NodeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
   2.394 -	: entry(_graph, t), exit(_graph, t) {}
   2.395 +//     template <typename T>
   2.396 +//     class NodeMap : public MapBase<Node, T> {
   2.397 +//       typedef typename Parent::template NodeMap<T> NodeImpl;
   2.398 +//     public:
   2.399 +//       NodeMap(const SplitGraphAdaptorBase& _graph) 
   2.400 +// 	: entry(_graph), exit(_graph) {}
   2.401 +//       NodeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
   2.402 +// 	: entry(_graph, t), exit(_graph, t) {}
   2.403        
   2.404 -      void set(const Node& key, const T& val) {
   2.405 -	if (key.entry) { entry.set(key, val); }
   2.406 -	else {exit.set(key, val); }
   2.407 -      }
   2.408 +//       void set(const Node& key, const T& val) {
   2.409 +// 	if (key.entry) { entry.set(key, val); }
   2.410 +// 	else {exit.set(key, val); }
   2.411 +//       }
   2.412        
   2.413 -      typename MapTraits<NodeImpl>::ReturnValue 
   2.414 -      operator[](const Node& key) {
   2.415 -	if (key.entry) { return entry[key]; }
   2.416 -	else { return exit[key]; }
   2.417 -      }
   2.418 +//       typename MapTraits<NodeImpl>::ReturnValue 
   2.419 +//       operator[](const Node& key) {
   2.420 +// 	if (key.entry) { return entry[key]; }
   2.421 +// 	else { return exit[key]; }
   2.422 +//       }
   2.423  
   2.424 -      typename MapTraits<NodeImpl>::ConstReturnValue
   2.425 -      operator[](const Node& key) const {
   2.426 -	if (key.entry) { return entry[key]; }
   2.427 -	else { return exit[key]; }
   2.428 -      }
   2.429 +//       typename MapTraits<NodeImpl>::ConstReturnValue
   2.430 +//       operator[](const Node& key) const {
   2.431 +// 	if (key.entry) { return entry[key]; }
   2.432 +// 	else { return exit[key]; }
   2.433 +//       }
   2.434  
   2.435 -    private:
   2.436 -      NodeImpl entry, exit;
   2.437 -    };
   2.438 +//     private:
   2.439 +//       NodeImpl entry, exit;
   2.440 +//     };
   2.441  
   2.442 -    template <typename T>
   2.443 -    class EdgeMap : public MapBase<Edge, T> {
   2.444 -      typedef typename Parent::template NodeMap<T> NodeImpl;
   2.445 -      typedef typename Parent::template EdgeMap<T> EdgeImpl;
   2.446 -    public:
   2.447 -      EdgeMap(const SplitGraphAdaptorBase& _graph) 
   2.448 -	: bind(_graph), orig(_graph) {}
   2.449 -      EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
   2.450 -	: bind(_graph, t), orig(_graph, t) {}
   2.451 +//     template <typename T>
   2.452 +//     class EdgeMap : public MapBase<Edge, T> {
   2.453 +//       typedef typename Parent::template NodeMap<T> NodeImpl;
   2.454 +//       typedef typename Parent::template EdgeMap<T> EdgeImpl;
   2.455 +//     public:
   2.456 +//       EdgeMap(const SplitGraphAdaptorBase& _graph) 
   2.457 +// 	: bind(_graph), orig(_graph) {}
   2.458 +//       EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
   2.459 +// 	: bind(_graph, t), orig(_graph, t) {}
   2.460        
   2.461 -      void set(const Edge& key, const T& val) {
   2.462 -	if ((typename Parent::Edge&)key != INVALID) { orig.set(key, val); }
   2.463 -	else {bind.set(key.bind, val); }
   2.464 -      }
   2.465 +//       void set(const Edge& key, const T& val) {
   2.466 +// 	if ((typename Parent::Edge&)key != INVALID) { orig.set(key, val); }
   2.467 +// 	else {bind.set(key.bind, val); }
   2.468 +//       }
   2.469        
   2.470 -      typename MapTraits<EdgeImpl>::ReturnValue
   2.471 -      operator[](const Edge& key) {
   2.472 -	if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
   2.473 -	else {return bind[key.bind]; }
   2.474 -      }
   2.475 +//       typename MapTraits<EdgeImpl>::ReturnValue
   2.476 +//       operator[](const Edge& key) {
   2.477 +// 	if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
   2.478 +// 	else {return bind[key.bind]; }
   2.479 +//       }
   2.480  
   2.481 -      typename MapTraits<EdgeImpl>::ConstReturnValue
   2.482 -      operator[](const Edge& key) const {
   2.483 -	if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
   2.484 -	else {return bind[key.bind]; }
   2.485 -      }
   2.486 +//       typename MapTraits<EdgeImpl>::ConstReturnValue
   2.487 +//       operator[](const Edge& key) const {
   2.488 +// 	if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
   2.489 +// 	else {return bind[key.bind]; }
   2.490 +//       }
   2.491  
   2.492 -    private:
   2.493 -      typename Parent::template NodeMap<T> bind;
   2.494 -      typename Parent::template EdgeMap<T> orig;
   2.495 -    };
   2.496 +//     private:
   2.497 +//       typename Parent::template NodeMap<T> bind;
   2.498 +//       typename Parent::template EdgeMap<T> orig;
   2.499 +//     };
   2.500  
   2.501 -    template <typename EntryMap, typename ExitMap>
   2.502 -    class CombinedNodeMap : public MapBase<Node, typename EntryMap::Value> {
   2.503 -    public:
   2.504 -      typedef MapBase<Node, typename EntryMap::Value> Parent;
   2.505 +//     template <typename EntryMap, typename ExitMap>
   2.506 +//     class CombinedNodeMap : public MapBase<Node, typename EntryMap::Value> {
   2.507 +//     public:
   2.508 +//       typedef MapBase<Node, typename EntryMap::Value> Parent;
   2.509  
   2.510 -      typedef typename Parent::Key Key;
   2.511 -      typedef typename Parent::Value Value;
   2.512 +//       typedef typename Parent::Key Key;
   2.513 +//       typedef typename Parent::Value Value;
   2.514  
   2.515 -      CombinedNodeMap(EntryMap& _entryMap, ExitMap& _exitMap) 
   2.516 -	: entryMap(_entryMap), exitMap(_exitMap) {}
   2.517 +//       CombinedNodeMap(EntryMap& _entryMap, ExitMap& _exitMap) 
   2.518 +// 	: entryMap(_entryMap), exitMap(_exitMap) {}
   2.519  
   2.520 -      Value& operator[](const Key& key) {
   2.521 -	if (key.entry) {
   2.522 -	  return entryMap[key];
   2.523 -	} else {
   2.524 -	  return exitMap[key];
   2.525 -	}
   2.526 -      }
   2.527 +//       Value& operator[](const Key& key) {
   2.528 +// 	if (key.entry) {
   2.529 +// 	  return entryMap[key];
   2.530 +// 	} else {
   2.531 +// 	  return exitMap[key];
   2.532 +// 	}
   2.533 +//       }
   2.534  
   2.535 -      Value operator[](const Key& key) const {
   2.536 -	if (key.entry) {
   2.537 -	  return entryMap[key];
   2.538 -	} else {
   2.539 -	  return exitMap[key];
   2.540 -	}
   2.541 -      }
   2.542 +//       Value operator[](const Key& key) const {
   2.543 +// 	if (key.entry) {
   2.544 +// 	  return entryMap[key];
   2.545 +// 	} else {
   2.546 +// 	  return exitMap[key];
   2.547 +// 	}
   2.548 +//       }
   2.549  
   2.550 -      void set(const Key& key, const Value& value) {
   2.551 -	if (key.entry) {
   2.552 -	  entryMap.set(key, value);
   2.553 -	} else {
   2.554 -	  exitMap.set(key, value);
   2.555 -	}
   2.556 -      }
   2.557 +//       void set(const Key& key, const Value& value) {
   2.558 +// 	if (key.entry) {
   2.559 +// 	  entryMap.set(key, value);
   2.560 +// 	} else {
   2.561 +// 	  exitMap.set(key, value);
   2.562 +// 	}
   2.563 +//       }
   2.564        
   2.565 -    private:
   2.566 +//     private:
   2.567        
   2.568 -      EntryMap& entryMap;
   2.569 -      ExitMap& exitMap;
   2.570 +//       EntryMap& entryMap;
   2.571 +//       ExitMap& exitMap;
   2.572        
   2.573 -    };
   2.574 +//     };
   2.575  
   2.576 -    template <typename EdgeMap, typename NodeMap>
   2.577 -    class CombinedEdgeMap : public MapBase<Edge, typename EdgeMap::Value> {
   2.578 -    public:
   2.579 -      typedef MapBase<Edge, typename EdgeMap::Value> Parent;
   2.580 +//     template <typename EdgeMap, typename NodeMap>
   2.581 +//     class CombinedEdgeMap : public MapBase<Edge, typename EdgeMap::Value> {
   2.582 +//     public:
   2.583 +//       typedef MapBase<Edge, typename EdgeMap::Value> Parent;
   2.584  
   2.585 -      typedef typename Parent::Key Key;
   2.586 -      typedef typename Parent::Value Value;
   2.587 +//       typedef typename Parent::Key Key;
   2.588 +//       typedef typename Parent::Value Value;
   2.589  
   2.590 -      CombinedEdgeMap(EdgeMap& _edgeMap, NodeMap& _nodeMap) 
   2.591 -	: edgeMap(_edgeMap), nodeMap(_nodeMap) {}
   2.592 +//       CombinedEdgeMap(EdgeMap& _edgeMap, NodeMap& _nodeMap) 
   2.593 +// 	: edgeMap(_edgeMap), nodeMap(_nodeMap) {}
   2.594  
   2.595 -      void set(const Edge& edge, const Value& val) {
   2.596 -	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.597 -	  edgeMap.set(edge, val);
   2.598 -	} else {
   2.599 -	  nodeMap.set(SplitGraphAdaptorBase::bindedNode(edge), val);
   2.600 -	}
   2.601 -      }
   2.602 +//       void set(const Edge& edge, const Value& val) {
   2.603 +// 	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.604 +// 	  edgeMap.set(edge, val);
   2.605 +// 	} else {
   2.606 +// 	  nodeMap.set(SplitGraphAdaptorBase::bindedNode(edge), val);
   2.607 +// 	}
   2.608 +//       }
   2.609  
   2.610 -      Value operator[](const Key& edge) const {
   2.611 -	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.612 -	  return edgeMap[edge];
   2.613 -	} else {
   2.614 -	  return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
   2.615 -	}
   2.616 -      }      
   2.617 +//       Value operator[](const Key& edge) const {
   2.618 +// 	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.619 +// 	  return edgeMap[edge];
   2.620 +// 	} else {
   2.621 +// 	  return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
   2.622 +// 	}
   2.623 +//       }      
   2.624  
   2.625 -      Value& operator[](const Key& edge) {
   2.626 -	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.627 -	  return edgeMap[edge];
   2.628 -	} else {
   2.629 -	  return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
   2.630 -	}
   2.631 -      }      
   2.632 +//       Value& operator[](const Key& edge) {
   2.633 +// 	if (SplitGraphAdaptorBase::originalEdge(edge)) {
   2.634 +// 	  return edgeMap[edge];
   2.635 +// 	} else {
   2.636 +// 	  return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
   2.637 +// 	}
   2.638 +//       }      
   2.639        
   2.640 -    private:
   2.641 -      EdgeMap& edgeMap;
   2.642 -      NodeMap& nodeMap;
   2.643 -    };
   2.644 +//     private:
   2.645 +//       EdgeMap& edgeMap;
   2.646 +//       NodeMap& nodeMap;
   2.647 +//     };
   2.648  
   2.649 -  };
   2.650 +//   };
   2.651  
   2.652 -  template <typename _Graph>
   2.653 -  class SplitGraphAdaptor 
   2.654 -    : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > {
   2.655 -  public:
   2.656 -    typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent;
   2.657 +//   template <typename _Graph>
   2.658 +//   class SplitGraphAdaptor 
   2.659 +//     : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > {
   2.660 +//   public:
   2.661 +//     typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent;
   2.662  
   2.663 -    SplitGraphAdaptor(_Graph& graph) {
   2.664 -      Parent::setGraph(graph);
   2.665 -    }
   2.666 +//     SplitGraphAdaptor(_Graph& graph) {
   2.667 +//       Parent::setGraph(graph);
   2.668 +//     }
   2.669  
   2.670  
   2.671 -  };
   2.672 +//   };
   2.673  
   2.674  } //namespace lemon
   2.675  
     3.1 --- a/lemon/traits.h	Wed Mar 01 09:40:16 2006 +0000
     3.2 +++ b/lemon/traits.h	Wed Mar 01 10:04:47 2006 +0000
     3.3 @@ -29,6 +29,19 @@
     3.4    template <typename _Graph, typename _Item>
     3.5    class ItemSetTraits {};
     3.6    
     3.7 +
     3.8 +  template <typename Graph, typename Enable = void>
     3.9 +  struct NodeNotifierIndicator {
    3.10 +    typedef InvalidType Type;
    3.11 +  };
    3.12 +  template <typename Graph>
    3.13 +  struct NodeNotifierIndicator<
    3.14 +    Graph, 
    3.15 +    typename enable_if<typename Graph::NodeNotifier::Notifier, void>::type
    3.16 +  > { 
    3.17 +    typedef typename Graph::NodeNotifier Type;
    3.18 +  };
    3.19 +
    3.20    template <typename _Graph>
    3.21    class ItemSetTraits<_Graph, typename _Graph::Node> {
    3.22    public:
    3.23 @@ -38,6 +51,8 @@
    3.24      typedef typename Graph::Node Item;
    3.25      typedef typename Graph::NodeIt ItemIt;
    3.26  
    3.27 +    typedef typename NodeNotifierIndicator<Graph>::Type ItemNotifier;
    3.28 +
    3.29      template <typename _Value>
    3.30      class Map : public Graph::template NodeMap<_Value> {
    3.31      public:
    3.32 @@ -47,8 +62,21 @@
    3.33        Map(const Graph& _graph) : Parent(_graph) {}
    3.34        Map(const Graph& _graph, const Value& _value) 
    3.35  	: Parent(_graph, _value) {}
    3.36 -    };
    3.37  
    3.38 +     };
    3.39 +
    3.40 +  };
    3.41 +
    3.42 +  template <typename Graph, typename Enable = void>
    3.43 +  struct EdgeNotifierIndicator {
    3.44 +    typedef InvalidType Type;
    3.45 +  };
    3.46 +  template <typename Graph>
    3.47 +  struct EdgeNotifierIndicator<
    3.48 +    Graph, 
    3.49 +    typename enable_if<typename Graph::EdgeNotifier::Notifier, void>::type
    3.50 +  > { 
    3.51 +    typedef typename Graph::EdgeNotifier Type;
    3.52    };
    3.53  
    3.54    template <typename _Graph>
    3.55 @@ -60,6 +88,8 @@
    3.56      typedef typename Graph::Edge Item;
    3.57      typedef typename Graph::EdgeIt ItemIt;
    3.58  
    3.59 +    typedef typename EdgeNotifierIndicator<Graph>::Type ItemNotifier;
    3.60 +
    3.61      template <typename _Value>
    3.62      class Map : public Graph::template EdgeMap<_Value> {
    3.63      public:
    3.64 @@ -73,6 +103,18 @@
    3.65  
    3.66    };
    3.67  
    3.68 +  template <typename Graph, typename Enable = void>
    3.69 +  struct UEdgeNotifierIndicator {
    3.70 +    typedef InvalidType Type;
    3.71 +  };
    3.72 +  template <typename Graph>
    3.73 +  struct UEdgeNotifierIndicator<
    3.74 +    Graph, 
    3.75 +    typename enable_if<typename Graph::UEdgeNotifier::Notifier, void>::type
    3.76 +  > { 
    3.77 +    typedef typename Graph::UEdgeNotifier Type;
    3.78 +  };
    3.79 +
    3.80    template <typename _Graph>
    3.81    class ItemSetTraits<_Graph, typename _Graph::UEdge> {
    3.82    public:
    3.83 @@ -82,6 +124,8 @@
    3.84      typedef typename Graph::UEdge Item;
    3.85      typedef typename Graph::UEdgeIt ItemIt;
    3.86  
    3.87 +    typedef typename UEdgeNotifierIndicator<Graph>::Type ItemNotifier;
    3.88 +
    3.89      template <typename _Value>
    3.90      class Map : public Graph::template UEdgeMap<_Value> {
    3.91      public:
    3.92 @@ -95,6 +139,17 @@
    3.93  
    3.94    };
    3.95  
    3.96 +  template <typename Graph, typename Enable = void>
    3.97 +  struct ANodeNotifierIndicator {
    3.98 +    typedef InvalidType Type;
    3.99 +  };
   3.100 +  template <typename Graph>
   3.101 +  struct ANodeNotifierIndicator<
   3.102 +    Graph, 
   3.103 +    typename enable_if<typename Graph::ANodeNotifier::Notifier, void>::type
   3.104 +  > { 
   3.105 +    typedef typename Graph::ANodeNotifier Type;
   3.106 +  };
   3.107  
   3.108    template <typename _Graph>
   3.109    class ItemSetTraits<_Graph, typename _Graph::ANode> {
   3.110 @@ -105,6 +160,8 @@
   3.111      typedef typename Graph::ANode Item;
   3.112      typedef typename Graph::ANodeIt ItemIt;
   3.113  
   3.114 +    typedef typename ANodeNotifierIndicator<Graph>::Type ItemNotifier;
   3.115 +
   3.116      template <typename _Value>
   3.117      class Map : public Graph::template ANodeMap<_Value> {
   3.118      public:
   3.119 @@ -118,6 +175,18 @@
   3.120  
   3.121    };
   3.122  
   3.123 +  template <typename Graph, typename Enable = void>
   3.124 +  struct BNodeNotifierIndicator {
   3.125 +    typedef InvalidType Type;
   3.126 +  };
   3.127 +  template <typename Graph>
   3.128 +  struct BNodeNotifierIndicator<
   3.129 +    Graph, 
   3.130 +    typename enable_if<typename Graph::BNodeNotifier::Notifier, void>::type
   3.131 +  > { 
   3.132 +    typedef typename Graph::BNodeNotifier Type;
   3.133 +  };
   3.134 +
   3.135    template <typename _Graph>
   3.136    class ItemSetTraits<_Graph, typename _Graph::BNode> {
   3.137    public:
   3.138 @@ -127,6 +196,8 @@
   3.139      typedef typename Graph::BNode Item;
   3.140      typedef typename Graph::BNodeIt ItemIt;
   3.141  
   3.142 +    typedef typename BNodeNotifierIndicator<Graph>::Type ItemNotifier;
   3.143 +
   3.144      template <typename _Value>
   3.145      class Map : public Graph::template BNodeMap<_Value> {
   3.146      public:
     4.1 --- a/lemon/utility.h	Wed Mar 01 09:40:16 2006 +0000
     4.2 +++ b/lemon/utility.h	Wed Mar 01 10:04:47 2006 +0000
     4.3 @@ -68,21 +68,12 @@
     4.4      static const bool value = false;
     4.5    };
     4.6  
     4.7 -  template <bool left, bool right>
     4.8 -  struct _CompileTimeAnd {
     4.9 -    static const bool value = false;
    4.10 +
    4.11 +  class InvalidType {
    4.12 +  private:
    4.13 +    InvalidType();
    4.14    };
    4.15    
    4.16 -  template <>
    4.17 -  struct _CompileTimeAnd<true, true> {
    4.18 -    static const bool value = true;
    4.19 -  };
    4.20 -
    4.21 -  template <typename Left, typename Right>
    4.22 -  struct CompileTimeAnd {
    4.23 -    static const bool value = 
    4.24 -    _CompileTimeAnd<Left::value, Right::value>::value;
    4.25 -  };
    4.26  
    4.27    template <typename T>
    4.28    struct Wrap {