[Lemon-commits] [lemon_svn] deba: r2591 - in hugo/trunk/lemon: . bits
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:53:45 CET 2006
Author: deba
Date: Wed Mar 1 11:04:47 2006
New Revision: 2591
Modified:
hugo/trunk/lemon/bits/alteration_notifier.h
hugo/trunk/lemon/graph_adaptor.h
hugo/trunk/lemon/traits.h
hugo/trunk/lemon/utility.h
Log:
Traits for alteration notifiers
SplitGraph is temporarly deleted
Modified: hugo/trunk/lemon/bits/alteration_notifier.h
==============================================================================
--- hugo/trunk/lemon/bits/alteration_notifier.h (original)
+++ hugo/trunk/lemon/bits/alteration_notifier.h Wed Mar 1 11:04:47 2006
@@ -16,8 +16,8 @@
*
*/
-#ifndef LEMON_ALTERATION_OBSERVER_REGISTRY_H
-#define LEMON_ALTERATION_OBSERVER_REGISTRY_H
+#ifndef LEMON_ALTERATION_NOTIFIER_H
+#define LEMON_ALTERATION_NOTIFIER_H
#include <vector>
#include <algorithm>
@@ -28,7 +28,7 @@
namespace lemon {
- /// \addtogroin graphmapfactory
+ /// \addtogroup graphmapfactory
/// @{
/// \brief Registry class to register objects observes alterations in
@@ -51,6 +51,9 @@
template <typename _Item>
class AlterationNotifier {
public:
+
+ typedef True Notifier;
+
typedef _Item Item;
/// ObserverBase is the base class for the observers.
Modified: hugo/trunk/lemon/graph_adaptor.h
==============================================================================
--- hugo/trunk/lemon/graph_adaptor.h (original)
+++ hugo/trunk/lemon/graph_adaptor.h Wed Mar 1 11:04:47 2006
@@ -1350,372 +1350,371 @@
};
- template <typename _Graph>
- class SplitGraphAdaptorBase
- : public GraphAdaptorBase<_Graph> {
- public:
- typedef GraphAdaptorBase<_Graph> Parent;
-
- class Node;
- class Edge;
- template <typename T> class NodeMap;
- template <typename T> class EdgeMap;
+// template <typename _Graph>
+// class SplitGraphAdaptorBase
+// : public GraphAdaptorBase<_Graph> {
+// public:
+// typedef GraphAdaptorBase<_Graph> Parent;
+
+// class Node;
+// class Edge;
+// template <typename T> class NodeMap;
+// template <typename T> class EdgeMap;
- class Node : public Parent::Node {
- friend class SplitGraphAdaptorBase;
- template <typename T> friend class NodeMap;
- typedef typename Parent::Node NodeParent;
- private:
-
- bool entry;
- Node(typename Parent::Node _node, bool _entry)
- : Parent::Node(_node), entry(_entry) {}
-
- public:
- Node() {}
- Node(Invalid) : NodeParent(INVALID), entry(true) {}
-
- bool operator==(const Node& node) const {
- return NodeParent::operator==(node) && entry == node.entry;
- }
-
- bool operator!=(const Node& node) const {
- return !(*this == node);
- }
-
- bool operator<(const Node& node) const {
- return NodeParent::operator<(node) ||
- (NodeParent::operator==(node) && entry < node.entry);
- }
- };
-
- /// \todo May we want VARIANT/union type
- class Edge : public Parent::Edge {
- friend class SplitGraphAdaptorBase;
- template <typename T> friend class EdgeMap;
- private:
- typedef typename Parent::Edge EdgeParent;
- typedef typename Parent::Node NodeParent;
- NodeParent bind;
-
- Edge(const EdgeParent& edge, const NodeParent& node)
- : EdgeParent(edge), bind(node) {}
- public:
- Edge() {}
- Edge(Invalid) : EdgeParent(INVALID), bind(INVALID) {}
-
- bool operator==(const Edge& edge) const {
- return EdgeParent::operator==(edge) && bind == edge.bind;
- }
-
- bool operator!=(const Edge& edge) const {
- return !(*this == edge);
- }
-
- bool operator<(const Edge& edge) const {
- return EdgeParent::operator<(edge) ||
- (EdgeParent::operator==(edge) && bind < edge.bind);
- }
- };
-
- void first(Node& node) const {
- Parent::first(node);
- node.entry = true;
- }
-
- void next(Node& node) const {
- if (node.entry) {
- node.entry = false;
- } else {
- node.entry = true;
- Parent::next(node);
- }
- }
-
- void first(Edge& edge) const {
- Parent::first(edge);
- if ((typename Parent::Edge&)edge == INVALID) {
- Parent::first(edge.bind);
- } else {
- edge.bind = INVALID;
- }
- }
-
- void next(Edge& edge) const {
- if ((typename Parent::Edge&)edge != INVALID) {
- Parent::next(edge);
- if ((typename Parent::Edge&)edge == INVALID) {
- Parent::first(edge.bind);
- }
- } else {
- Parent::next(edge.bind);
- }
- }
-
- void firstIn(Edge& edge, const Node& node) const {
- if (node.entry) {
- Parent::firstIn(edge, node);
- edge.bind = INVALID;
- } else {
- (typename Parent::Edge&)edge = INVALID;
- edge.bind = node;
- }
- }
-
- void nextIn(Edge& edge) const {
- if ((typename Parent::Edge&)edge != INVALID) {
- Parent::nextIn(edge);
- } else {
- edge.bind = INVALID;
- }
- }
-
- void firstOut(Edge& edge, const Node& node) const {
- if (!node.entry) {
- Parent::firstOut(edge, node);
- edge.bind = INVALID;
- } else {
- (typename Parent::Edge&)edge = INVALID;
- edge.bind = node;
- }
- }
-
- void nextOut(Edge& edge) const {
- if ((typename Parent::Edge&)edge != INVALID) {
- Parent::nextOut(edge);
- } else {
- edge.bind = INVALID;
- }
- }
-
- Node source(const Edge& edge) const {
- if ((typename Parent::Edge&)edge != INVALID) {
- return Node(Parent::source(edge), false);
- } else {
- return Node(edge.bind, true);
- }
- }
-
- Node target(const Edge& edge) const {
- if ((typename Parent::Edge&)edge != INVALID) {
- return Node(Parent::target(edge), true);
- } else {
- return Node(edge.bind, false);
- }
- }
-
- static bool entryNode(const Node& node) {
- return node.entry;
- }
-
- static bool exitNode(const Node& node) {
- return !node.entry;
- }
-
- static Node getEntry(const typename Parent::Node& node) {
- return Node(node, true);
- }
-
- static Node getExit(const typename Parent::Node& node) {
- return Node(node, false);
- }
-
- static bool originalEdge(const Edge& edge) {
- return (typename Parent::Edge&)edge != INVALID;
- }
-
- static bool bindingEdge(const Edge& edge) {
- return edge.bind != INVALID;
- }
-
- static Node getBindedNode(const Edge& edge) {
- return edge.bind;
- }
-
- int nodeNum() const {
- return Parent::nodeNum() * 2;
- }
+// class Node : public Parent::Node {
+// friend class SplitGraphAdaptorBase;
+// template <typename T> friend class NodeMap;
+// typedef typename Parent::Node NodeParent;
+// private:
+
+// bool entry;
+// Node(typename Parent::Node _node, bool _entry)
+// : Parent::Node(_node), entry(_entry) {}
+
+// public:
+// Node() {}
+// Node(Invalid) : NodeParent(INVALID), entry(true) {}
+
+// bool operator==(const Node& node) const {
+// return NodeParent::operator==(node) && entry == node.entry;
+// }
+
+// bool operator!=(const Node& node) const {
+// return !(*this == node);
+// }
+
+// bool operator<(const Node& node) const {
+// return NodeParent::operator<(node) ||
+// (NodeParent::operator==(node) && entry < node.entry);
+// }
+// };
+
+// /// \todo May we want VARIANT/union type
+// class Edge : public Parent::Edge {
+// friend class SplitGraphAdaptorBase;
+// template <typename T> friend class EdgeMap;
+// private:
+// typedef typename Parent::Edge EdgeParent;
+// typedef typename Parent::Node NodeParent;
+// NodeParent bind;
+
+// Edge(const EdgeParent& edge, const NodeParent& node)
+// : EdgeParent(edge), bind(node) {}
+// public:
+// Edge() {}
+// Edge(Invalid) : EdgeParent(INVALID), bind(INVALID) {}
+
+// bool operator==(const Edge& edge) const {
+// return EdgeParent::operator==(edge) && bind == edge.bind;
+// }
+
+// bool operator!=(const Edge& edge) const {
+// return !(*this == edge);
+// }
+
+// bool operator<(const Edge& edge) const {
+// return EdgeParent::operator<(edge) ||
+// (EdgeParent::operator==(edge) && bind < edge.bind);
+// }
+// };
+
+// void first(Node& node) const {
+// Parent::first(node);
+// node.entry = true;
+// }
+
+// void next(Node& node) const {
+// if (node.entry) {
+// node.entry = false;
+// } else {
+// node.entry = true;
+// Parent::next(node);
+// }
+// }
+
+// void first(Edge& edge) const {
+// Parent::first(edge);
+// if ((typename Parent::Edge&)edge == INVALID) {
+// Parent::first(edge.bind);
+// } else {
+// edge.bind = INVALID;
+// }
+// }
+
+// void next(Edge& edge) const {
+// if ((typename Parent::Edge&)edge != INVALID) {
+// Parent::next(edge);
+// if ((typename Parent::Edge&)edge == INVALID) {
+// Parent::first(edge.bind);
+// }
+// } else {
+// Parent::next(edge.bind);
+// }
+// }
+
+// void firstIn(Edge& edge, const Node& node) const {
+// if (node.entry) {
+// Parent::firstIn(edge, node);
+// edge.bind = INVALID;
+// } else {
+// (typename Parent::Edge&)edge = INVALID;
+// edge.bind = node;
+// }
+// }
+
+// void nextIn(Edge& edge) const {
+// if ((typename Parent::Edge&)edge != INVALID) {
+// Parent::nextIn(edge);
+// } else {
+// edge.bind = INVALID;
+// }
+// }
+
+// void firstOut(Edge& edge, const Node& node) const {
+// if (!node.entry) {
+// Parent::firstOut(edge, node);
+// edge.bind = INVALID;
+// } else {
+// (typename Parent::Edge&)edge = INVALID;
+// edge.bind = node;
+// }
+// }
+
+// void nextOut(Edge& edge) const {
+// if ((typename Parent::Edge&)edge != INVALID) {
+// Parent::nextOut(edge);
+// } else {
+// edge.bind = INVALID;
+// }
+// }
+
+// Node source(const Edge& edge) const {
+// if ((typename Parent::Edge&)edge != INVALID) {
+// return Node(Parent::source(edge), false);
+// } else {
+// return Node(edge.bind, true);
+// }
+// }
+
+// Node target(const Edge& edge) const {
+// if ((typename Parent::Edge&)edge != INVALID) {
+// return Node(Parent::target(edge), true);
+// } else {
+// return Node(edge.bind, false);
+// }
+// }
+
+// static bool entryNode(const Node& node) {
+// return node.entry;
+// }
+
+// static bool exitNode(const Node& node) {
+// return !node.entry;
+// }
+
+// static Node getEntry(const typename Parent::Node& node) {
+// return Node(node, true);
+// }
+
+// static Node getExit(const typename Parent::Node& node) {
+// return Node(node, false);
+// }
+
+// static bool originalEdge(const Edge& edge) {
+// return (typename Parent::Edge&)edge != INVALID;
+// }
+
+// static bool bindingEdge(const Edge& edge) {
+// return edge.bind != INVALID;
+// }
+
+// static Node getBindedNode(const Edge& edge) {
+// return edge.bind;
+// }
+
+// int nodeNum() const {
+// return Parent::nodeNum() * 2;
+// }
- typedef CompileTimeAnd<typename Parent::NodeNumTag,
- typename Parent::EdgeNumTag> EdgeNumTag;
+// typedef True EdgeNumTag;
- int edgeNum() const {
- return Parent::edgeNum() + Parent::nodeNum();
- }
-
- Edge findEdge(const Node& source, const Node& target,
- const Edge& prev = INVALID) const {
- if (exitNode(source) && entryNode(target)) {
- return Parent::findEdge(source, target, prev);
- } else {
- if (prev == INVALID && entryNode(source) && exitNode(target) &&
- (typename Parent::Node&)source == (typename Parent::Node&)target) {
- return Edge(INVALID, source);
- } else {
- return INVALID;
- }
- }
- }
+// int edgeNum() const {
+// return countEdges() + Parent::nodeNum();
+// }
+
+// Edge findEdge(const Node& source, const Node& target,
+// const Edge& prev = INVALID) const {
+// if (exitNode(source) && entryNode(target)) {
+// return Parent::findEdge(source, target, prev);
+// } else {
+// if (prev == INVALID && entryNode(source) && exitNode(target) &&
+// (typename Parent::Node&)source == (typename Parent::Node&)target) {
+// return Edge(INVALID, source);
+// } else {
+// return INVALID;
+// }
+// }
+// }
- template <typename T>
- class NodeMap : public MapBase<Node, T> {
- typedef typename Parent::template NodeMap<T> NodeImpl;
- public:
- NodeMap(const SplitGraphAdaptorBase& _graph)
- : entry(_graph), exit(_graph) {}
- NodeMap(const SplitGraphAdaptorBase& _graph, const T& t)
- : entry(_graph, t), exit(_graph, t) {}
-
- void set(const Node& key, const T& val) {
- if (key.entry) { entry.set(key, val); }
- else {exit.set(key, val); }
- }
-
- typename MapTraits<NodeImpl>::ReturnValue
- operator[](const Node& key) {
- if (key.entry) { return entry[key]; }
- else { return exit[key]; }
- }
-
- typename MapTraits<NodeImpl>::ConstReturnValue
- operator[](const Node& key) const {
- if (key.entry) { return entry[key]; }
- else { return exit[key]; }
- }
-
- private:
- NodeImpl entry, exit;
- };
-
- template <typename T>
- class EdgeMap : public MapBase<Edge, T> {
- typedef typename Parent::template NodeMap<T> NodeImpl;
- typedef typename Parent::template EdgeMap<T> EdgeImpl;
- public:
- EdgeMap(const SplitGraphAdaptorBase& _graph)
- : bind(_graph), orig(_graph) {}
- EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t)
- : bind(_graph, t), orig(_graph, t) {}
-
- void set(const Edge& key, const T& val) {
- if ((typename Parent::Edge&)key != INVALID) { orig.set(key, val); }
- else {bind.set(key.bind, val); }
- }
-
- typename MapTraits<EdgeImpl>::ReturnValue
- operator[](const Edge& key) {
- if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
- else {return bind[key.bind]; }
- }
-
- typename MapTraits<EdgeImpl>::ConstReturnValue
- operator[](const Edge& key) const {
- if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
- else {return bind[key.bind]; }
- }
-
- private:
- typename Parent::template NodeMap<T> bind;
- typename Parent::template EdgeMap<T> orig;
- };
-
- template <typename EntryMap, typename ExitMap>
- class CombinedNodeMap : public MapBase<Node, typename EntryMap::Value> {
- public:
- typedef MapBase<Node, typename EntryMap::Value> Parent;
-
- typedef typename Parent::Key Key;
- typedef typename Parent::Value Value;
-
- CombinedNodeMap(EntryMap& _entryMap, ExitMap& _exitMap)
- : entryMap(_entryMap), exitMap(_exitMap) {}
-
- Value& operator[](const Key& key) {
- if (key.entry) {
- return entryMap[key];
- } else {
- return exitMap[key];
- }
- }
-
- Value operator[](const Key& key) const {
- if (key.entry) {
- return entryMap[key];
- } else {
- return exitMap[key];
- }
- }
-
- void set(const Key& key, const Value& value) {
- if (key.entry) {
- entryMap.set(key, value);
- } else {
- exitMap.set(key, value);
- }
- }
-
- private:
-
- EntryMap& entryMap;
- ExitMap& exitMap;
-
- };
-
- template <typename EdgeMap, typename NodeMap>
- class CombinedEdgeMap : public MapBase<Edge, typename EdgeMap::Value> {
- public:
- typedef MapBase<Edge, typename EdgeMap::Value> Parent;
-
- typedef typename Parent::Key Key;
- typedef typename Parent::Value Value;
-
- CombinedEdgeMap(EdgeMap& _edgeMap, NodeMap& _nodeMap)
- : edgeMap(_edgeMap), nodeMap(_nodeMap) {}
-
- void set(const Edge& edge, const Value& val) {
- if (SplitGraphAdaptorBase::originalEdge(edge)) {
- edgeMap.set(edge, val);
- } else {
- nodeMap.set(SplitGraphAdaptorBase::bindedNode(edge), val);
- }
- }
-
- Value operator[](const Key& edge) const {
- if (SplitGraphAdaptorBase::originalEdge(edge)) {
- return edgeMap[edge];
- } else {
- return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
- }
- }
-
- Value& operator[](const Key& edge) {
- if (SplitGraphAdaptorBase::originalEdge(edge)) {
- return edgeMap[edge];
- } else {
- return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
- }
- }
-
- private:
- EdgeMap& edgeMap;
- NodeMap& nodeMap;
- };
+// template <typename T>
+// class NodeMap : public MapBase<Node, T> {
+// typedef typename Parent::template NodeMap<T> NodeImpl;
+// public:
+// NodeMap(const SplitGraphAdaptorBase& _graph)
+// : entry(_graph), exit(_graph) {}
+// NodeMap(const SplitGraphAdaptorBase& _graph, const T& t)
+// : entry(_graph, t), exit(_graph, t) {}
+
+// void set(const Node& key, const T& val) {
+// if (key.entry) { entry.set(key, val); }
+// else {exit.set(key, val); }
+// }
+
+// typename MapTraits<NodeImpl>::ReturnValue
+// operator[](const Node& key) {
+// if (key.entry) { return entry[key]; }
+// else { return exit[key]; }
+// }
+
+// typename MapTraits<NodeImpl>::ConstReturnValue
+// operator[](const Node& key) const {
+// if (key.entry) { return entry[key]; }
+// else { return exit[key]; }
+// }
+
+// private:
+// NodeImpl entry, exit;
+// };
+
+// template <typename T>
+// class EdgeMap : public MapBase<Edge, T> {
+// typedef typename Parent::template NodeMap<T> NodeImpl;
+// typedef typename Parent::template EdgeMap<T> EdgeImpl;
+// public:
+// EdgeMap(const SplitGraphAdaptorBase& _graph)
+// : bind(_graph), orig(_graph) {}
+// EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t)
+// : bind(_graph, t), orig(_graph, t) {}
+
+// void set(const Edge& key, const T& val) {
+// if ((typename Parent::Edge&)key != INVALID) { orig.set(key, val); }
+// else {bind.set(key.bind, val); }
+// }
+
+// typename MapTraits<EdgeImpl>::ReturnValue
+// operator[](const Edge& key) {
+// if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
+// else {return bind[key.bind]; }
+// }
+
+// typename MapTraits<EdgeImpl>::ConstReturnValue
+// operator[](const Edge& key) const {
+// if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
+// else {return bind[key.bind]; }
+// }
+
+// private:
+// typename Parent::template NodeMap<T> bind;
+// typename Parent::template EdgeMap<T> orig;
+// };
+
+// template <typename EntryMap, typename ExitMap>
+// class CombinedNodeMap : public MapBase<Node, typename EntryMap::Value> {
+// public:
+// typedef MapBase<Node, typename EntryMap::Value> Parent;
+
+// typedef typename Parent::Key Key;
+// typedef typename Parent::Value Value;
+
+// CombinedNodeMap(EntryMap& _entryMap, ExitMap& _exitMap)
+// : entryMap(_entryMap), exitMap(_exitMap) {}
+
+// Value& operator[](const Key& key) {
+// if (key.entry) {
+// return entryMap[key];
+// } else {
+// return exitMap[key];
+// }
+// }
+
+// Value operator[](const Key& key) const {
+// if (key.entry) {
+// return entryMap[key];
+// } else {
+// return exitMap[key];
+// }
+// }
+
+// void set(const Key& key, const Value& value) {
+// if (key.entry) {
+// entryMap.set(key, value);
+// } else {
+// exitMap.set(key, value);
+// }
+// }
+
+// private:
+
+// EntryMap& entryMap;
+// ExitMap& exitMap;
+
+// };
+
+// template <typename EdgeMap, typename NodeMap>
+// class CombinedEdgeMap : public MapBase<Edge, typename EdgeMap::Value> {
+// public:
+// typedef MapBase<Edge, typename EdgeMap::Value> Parent;
+
+// typedef typename Parent::Key Key;
+// typedef typename Parent::Value Value;
+
+// CombinedEdgeMap(EdgeMap& _edgeMap, NodeMap& _nodeMap)
+// : edgeMap(_edgeMap), nodeMap(_nodeMap) {}
+
+// void set(const Edge& edge, const Value& val) {
+// if (SplitGraphAdaptorBase::originalEdge(edge)) {
+// edgeMap.set(edge, val);
+// } else {
+// nodeMap.set(SplitGraphAdaptorBase::bindedNode(edge), val);
+// }
+// }
+
+// Value operator[](const Key& edge) const {
+// if (SplitGraphAdaptorBase::originalEdge(edge)) {
+// return edgeMap[edge];
+// } else {
+// return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
+// }
+// }
+
+// Value& operator[](const Key& edge) {
+// if (SplitGraphAdaptorBase::originalEdge(edge)) {
+// return edgeMap[edge];
+// } else {
+// return nodeMap[SplitGraphAdaptorBase::bindedNode(edge)];
+// }
+// }
+
+// private:
+// EdgeMap& edgeMap;
+// NodeMap& nodeMap;
+// };
+
+// };
+
+// template <typename _Graph>
+// class SplitGraphAdaptor
+// : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > {
+// public:
+// typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent;
+
+// SplitGraphAdaptor(_Graph& graph) {
+// Parent::setGraph(graph);
+// }
- };
-
- template <typename _Graph>
- class SplitGraphAdaptor
- : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > {
- public:
- typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent;
-
- SplitGraphAdaptor(_Graph& graph) {
- Parent::setGraph(graph);
- }
-
- };
+// };
} //namespace lemon
Modified: hugo/trunk/lemon/traits.h
==============================================================================
--- hugo/trunk/lemon/traits.h (original)
+++ hugo/trunk/lemon/traits.h Wed Mar 1 11:04:47 2006
@@ -29,6 +29,19 @@
template <typename _Graph, typename _Item>
class ItemSetTraits {};
+
+ template <typename Graph, typename Enable = void>
+ struct NodeNotifierIndicator {
+ typedef InvalidType Type;
+ };
+ template <typename Graph>
+ struct NodeNotifierIndicator<
+ Graph,
+ typename enable_if<typename Graph::NodeNotifier::Notifier, void>::type
+ > {
+ typedef typename Graph::NodeNotifier Type;
+ };
+
template <typename _Graph>
class ItemSetTraits<_Graph, typename _Graph::Node> {
public:
@@ -38,6 +51,8 @@
typedef typename Graph::Node Item;
typedef typename Graph::NodeIt ItemIt;
+ typedef typename NodeNotifierIndicator<Graph>::Type ItemNotifier;
+
template <typename _Value>
class Map : public Graph::template NodeMap<_Value> {
public:
@@ -47,10 +62,23 @@
Map(const Graph& _graph) : Parent(_graph) {}
Map(const Graph& _graph, const Value& _value)
: Parent(_graph, _value) {}
- };
+
+ };
};
+ template <typename Graph, typename Enable = void>
+ struct EdgeNotifierIndicator {
+ typedef InvalidType Type;
+ };
+ template <typename Graph>
+ struct EdgeNotifierIndicator<
+ Graph,
+ typename enable_if<typename Graph::EdgeNotifier::Notifier, void>::type
+ > {
+ typedef typename Graph::EdgeNotifier Type;
+ };
+
template <typename _Graph>
class ItemSetTraits<_Graph, typename _Graph::Edge> {
public:
@@ -60,6 +88,8 @@
typedef typename Graph::Edge Item;
typedef typename Graph::EdgeIt ItemIt;
+ typedef typename EdgeNotifierIndicator<Graph>::Type ItemNotifier;
+
template <typename _Value>
class Map : public Graph::template EdgeMap<_Value> {
public:
@@ -73,6 +103,18 @@
};
+ template <typename Graph, typename Enable = void>
+ struct UEdgeNotifierIndicator {
+ typedef InvalidType Type;
+ };
+ template <typename Graph>
+ struct UEdgeNotifierIndicator<
+ Graph,
+ typename enable_if<typename Graph::UEdgeNotifier::Notifier, void>::type
+ > {
+ typedef typename Graph::UEdgeNotifier Type;
+ };
+
template <typename _Graph>
class ItemSetTraits<_Graph, typename _Graph::UEdge> {
public:
@@ -82,6 +124,8 @@
typedef typename Graph::UEdge Item;
typedef typename Graph::UEdgeIt ItemIt;
+ typedef typename UEdgeNotifierIndicator<Graph>::Type ItemNotifier;
+
template <typename _Value>
class Map : public Graph::template UEdgeMap<_Value> {
public:
@@ -95,6 +139,17 @@
};
+ template <typename Graph, typename Enable = void>
+ struct ANodeNotifierIndicator {
+ typedef InvalidType Type;
+ };
+ template <typename Graph>
+ struct ANodeNotifierIndicator<
+ Graph,
+ typename enable_if<typename Graph::ANodeNotifier::Notifier, void>::type
+ > {
+ typedef typename Graph::ANodeNotifier Type;
+ };
template <typename _Graph>
class ItemSetTraits<_Graph, typename _Graph::ANode> {
@@ -105,6 +160,8 @@
typedef typename Graph::ANode Item;
typedef typename Graph::ANodeIt ItemIt;
+ typedef typename ANodeNotifierIndicator<Graph>::Type ItemNotifier;
+
template <typename _Value>
class Map : public Graph::template ANodeMap<_Value> {
public:
@@ -118,6 +175,18 @@
};
+ template <typename Graph, typename Enable = void>
+ struct BNodeNotifierIndicator {
+ typedef InvalidType Type;
+ };
+ template <typename Graph>
+ struct BNodeNotifierIndicator<
+ Graph,
+ typename enable_if<typename Graph::BNodeNotifier::Notifier, void>::type
+ > {
+ typedef typename Graph::BNodeNotifier Type;
+ };
+
template <typename _Graph>
class ItemSetTraits<_Graph, typename _Graph::BNode> {
public:
@@ -127,6 +196,8 @@
typedef typename Graph::BNode Item;
typedef typename Graph::BNodeIt ItemIt;
+ typedef typename BNodeNotifierIndicator<Graph>::Type ItemNotifier;
+
template <typename _Value>
class Map : public Graph::template BNodeMap<_Value> {
public:
Modified: hugo/trunk/lemon/utility.h
==============================================================================
--- hugo/trunk/lemon/utility.h (original)
+++ hugo/trunk/lemon/utility.h Wed Mar 1 11:04:47 2006
@@ -68,21 +68,12 @@
static const bool value = false;
};
- template <bool left, bool right>
- struct _CompileTimeAnd {
- static const bool value = false;
- };
-
- template <>
- struct _CompileTimeAnd<true, true> {
- static const bool value = true;
- };
- template <typename Left, typename Right>
- struct CompileTimeAnd {
- static const bool value =
- _CompileTimeAnd<Left::value, Right::value>::value;
+ class InvalidType {
+ private:
+ InvalidType();
};
+
template <typename T>
struct Wrap {
More information about the Lemon-commits
mailing list