1.1 --- a/lemon/bits/traits.h Sun Nov 14 16:35:31 2010 +0100
1.2 +++ b/lemon/bits/traits.h Sun Nov 14 20:06:23 2010 +0100
1.3 @@ -151,6 +151,88 @@
1.4
1.5 };
1.6
1.7 + template <typename GR, typename Enable = void>
1.8 + struct RedNodeNotifierIndicator {
1.9 + typedef InvalidType Type;
1.10 + };
1.11 + template <typename GR>
1.12 + struct RedNodeNotifierIndicator<
1.13 + GR,
1.14 + typename enable_if<typename GR::RedNodeNotifier::Notifier, void>::type
1.15 + > {
1.16 + typedef typename GR::RedNodeNotifier Type;
1.17 + };
1.18 +
1.19 + template <typename GR>
1.20 + class ItemSetTraits<GR, typename GR::RedNode> {
1.21 + public:
1.22 +
1.23 + typedef GR BpGraph;
1.24 + typedef GR Graph;
1.25 + typedef GR Digraph;
1.26 +
1.27 + typedef typename GR::RedNode Item;
1.28 + typedef typename GR::RedIt ItemIt;
1.29 +
1.30 + typedef typename RedNodeNotifierIndicator<GR>::Type ItemNotifier;
1.31 +
1.32 + template <typename V>
1.33 + class Map : public GR::template RedMap<V> {
1.34 + typedef typename GR::template RedMap<V> Parent;
1.35 +
1.36 + public:
1.37 + typedef typename GR::template RedMap<V> Type;
1.38 + typedef typename Parent::Value Value;
1.39 +
1.40 + Map(const GR& _bpgraph) : Parent(_bpgraph) {}
1.41 + Map(const GR& _bpgraph, const Value& _value)
1.42 + : Parent(_bpgraph, _value) {}
1.43 +
1.44 + };
1.45 +
1.46 + };
1.47 +
1.48 + template <typename GR, typename Enable = void>
1.49 + struct BlueNodeNotifierIndicator {
1.50 + typedef InvalidType Type;
1.51 + };
1.52 + template <typename GR>
1.53 + struct BlueNodeNotifierIndicator<
1.54 + GR,
1.55 + typename enable_if<typename GR::BlueNodeNotifier::Notifier, void>::type
1.56 + > {
1.57 + typedef typename GR::BlueNodeNotifier Type;
1.58 + };
1.59 +
1.60 + template <typename GR>
1.61 + class ItemSetTraits<GR, typename GR::BlueNode> {
1.62 + public:
1.63 +
1.64 + typedef GR BpGraph;
1.65 + typedef GR Graph;
1.66 + typedef GR Digraph;
1.67 +
1.68 + typedef typename GR::BlueNode Item;
1.69 + typedef typename GR::BlueIt ItemIt;
1.70 +
1.71 + typedef typename BlueNodeNotifierIndicator<GR>::Type ItemNotifier;
1.72 +
1.73 + template <typename V>
1.74 + class Map : public GR::template BlueMap<V> {
1.75 + typedef typename GR::template BlueMap<V> Parent;
1.76 +
1.77 + public:
1.78 + typedef typename GR::template BlueMap<V> Type;
1.79 + typedef typename Parent::Value Value;
1.80 +
1.81 + Map(const GR& _bpgraph) : Parent(_bpgraph) {}
1.82 + Map(const GR& _bpgraph, const Value& _value)
1.83 + : Parent(_bpgraph, _value) {}
1.84 +
1.85 + };
1.86 +
1.87 + };
1.88 +
1.89 template <typename Map, typename Enable = void>
1.90 struct MapTraits {
1.91 typedef False ReferenceMapTag;