diff -r 3a48bc350e0f -r 74589d20dbc3 src/hugo/map_defines.h --- a/src/hugo/map_defines.h Mon Sep 20 17:53:33 2004 +0000 +++ b/src/hugo/map_defines.h Mon Sep 20 22:57:48 2004 +0000 @@ -38,21 +38,24 @@ #define CREATE_NODE_MAP(DynMap) \ template \ class NodeMap : public DynMap { \ -typedef DynMap MapImpl; \ public: \ +typedef DynMap Parent; \ NodeMap() {} \ -NodeMap(const typename MapImpl::Graph& g) \ - : MapImpl(g, g.node_maps) {} \ -NodeMap(const typename MapImpl::Graph& g, const Value& v) \ - : MapImpl(g, g.node_maps, v) {} \ -NodeMap(const NodeMap& copy) : MapImpl(static_cast(copy)) {} \ -template NodeMap(const CMap& copy) : MapImpl(copy) {} \ +NodeMap(const typename Parent::Graph& g) \ + : Parent(g, g.node_maps) {} \ +NodeMap(const typename Parent::Graph& g, const Value& v) \ + : Parent(g, g.node_maps, v) {} \ +NodeMap(const NodeMap& copy) : Parent(static_cast(copy)) {} \ +template \ +NodeMap(const NodeMap& copy) \ + : Parent(static_cast::Parent&>(copy)) {} \ NodeMap& operator=(const NodeMap& copy) { \ - MapImpl::operator=(static_cast(copy));\ + Parent::operator=(static_cast(copy));\ return *this; \ } \ -template NodeMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy);\ +template \ +NodeMap& operator=(const NodeMap& copy) { \ + Parent::operator=(static_cast::Parent&>(copy));\ return *this; \ } \ }; @@ -66,21 +69,25 @@ #define CREATE_EDGE_MAP(DynMap) \ template \ class EdgeMap : public DynMap { \ -typedef DynMap MapImpl; \ public: \ +typedef DynMap Parent; \ +\ EdgeMap() {} \ -EdgeMap(const typename MapImpl::Graph& g) \ - : MapImpl(g, g.edge_maps) {} \ -EdgeMap(const typename MapImpl::Graph& g, const Value& v) \ - : MapImpl(g, g.edge_maps, v) {} \ -EdgeMap(const EdgeMap& copy) : MapImpl(static_cast(copy)) {} \ -template EdgeMap(const CMap& copy) : MapImpl(copy) {} \ +EdgeMap(const typename Parent::Graph& g) \ + : Parent(g, g.edge_maps) {} \ +EdgeMap(const typename Parent::Graph& g, const Value& v) \ + : Parent(g, g.edge_maps, v) {} \ +EdgeMap(const EdgeMap& copy) : Parent(static_cast(copy)) {} \ +template \ +EdgeMap(const EdgeMap& copy) \ + : Parent(static_cast::Parent&>(copy)) {} \ EdgeMap& operator=(const EdgeMap& copy) { \ - MapImpl::operator=(static_cast(copy));\ + Parent::operator=(static_cast(copy));\ return *this; \ } \ -template EdgeMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy);\ +template \ +EdgeMap& operator=(const EdgeMap& copy) { \ + Parent::operator=(static_cast::Parent&>(copy));\ return *this; \ } \ }; @@ -108,101 +115,88 @@ #define CREATE_SYM_EDGE_MAP(DynMap) \ template \ class SymEdgeMap : public SymMap { \ - typedef SymMap MapImpl; \ - public: \ +public: \ +typedef SymMap Parent; \ \ - SymEdgeMap() {} \ -\ - SymEdgeMap(const typename MapImpl::Graph& g) \ - : MapImpl(g, g.sym_edge_maps) {} \ -\ - SymEdgeMap(const typename MapImpl::Graph& g, const Value& v) \ - : MapImpl(g, g.sym_edge_maps, v) {} \ -\ - SymEdgeMap(const SymEdgeMap& copy) \ - : MapImpl(static_cast(copy)) {} \ -\ - template SymEdgeMap(const CMap& copy) : MapImpl(copy) {} \ - SymEdgeMap& operator=(const SymEdgeMap& copy) { \ - MapImpl::operator=(static_cast(copy));\ - return *this; \ - } \ -\ - template SymEdgeMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy);\ - return *this; \ - } \ +SymEdgeMap() {} \ +SymEdgeMap(const typename Parent::Graph& g) \ + : Parent(g, g.sym_edge_maps) {} \ +SymEdgeMap(const typename Parent::Graph& g, const Value& v) \ + : Parent(g, g.sym_edge_maps, v) {} \ +SymEdgeMap(const SymEdgeMap& copy) \ + : Parent(static_cast(copy)) {} \ +template \ +SymEdgeMap(const NodeMap& copy) \ + : Parent(static_cast::Parent&>(copy)) {} \ +SymEdgeMap& operator=(const SymEdgeMap& copy) { \ + Parent::operator=(static_cast(copy));\ + return *this; \ +} \ +template \ +SymEdgeMap& operator=(const SymEdgeMap& copy) { \ + Parent::operator=(static_cast::Parent&>(copy));\ + return *this; \ +} \ }; - /** This is a macro to import an node map into a graph class. */ #define IMPORT_NODE_MAP(From, from, To, to) \ template \ -class NodeMap \ - : public From::template NodeMap { \ - typedef typename From::template NodeMap MapImpl; \ - public: \ - NodeMap() : MapImpl() {} \ +class NodeMap : public From::template NodeMap { \ \ - NodeMap(const To& to) \ - : MapImpl(static_cast(from)) { } \ +public: \ +typedef typename From::template NodeMap Parent; \ \ - NodeMap(const To& to, const Value& value) \ - : MapImpl(static_cast(from), value) { } \ -\ - NodeMap(const NodeMap& copy) \ - : MapImpl(static_cast(copy)) {} \ -\ - template \ - NodeMap(const CMap& copy) \ - : MapImpl(copy) {} \ -\ - NodeMap& operator=(const NodeMap& copy) { \ - MapImpl::operator=(static_cast(copy)); \ - return *this; \ - } \ -\ - template \ - NodeMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy); \ - return *this; \ - } \ +NodeMap() : Parent() {} \ +NodeMap(const To& to) \ + : Parent(static_cast(from)) { } \ +NodeMap(const To& to, const Value& value) \ + : Parent(static_cast(from), value) { } \ +NodeMap(const NodeMap& copy) \ + : Parent(static_cast(copy)) {} \ +template \ +NodeMap(const NodeMap& copy) \ + : Parent(static_cast::Parent&>(copy)) {} \ +NodeMap& operator=(const NodeMap& copy) { \ + Parent::operator=(static_cast(copy)); \ + return *this; \ +} \ +template \ +NodeMap& operator=(const NodeMap& copy) { \ + Parent::operator=(static_cast::Parent&>(copy));\ + return *this; \ +} \ }; /** This is a macro to import an edge map into a graph class. */ #define IMPORT_EDGE_MAP(From, from, To, to) \ template \ -class EdgeMap \ - : public From::template EdgeMap { \ - typedef typename From::template EdgeMap MapImpl; \ - public: \ - EdgeMap() : MapImpl() {} \ +class EdgeMap : public From::template EdgeMap { \ \ - EdgeMap(const To& to) \ - : MapImpl(static_cast(from)) { } \ +public: \ +typedef typename From::template EdgeMap Parent; \ \ - EdgeMap(const To& to, const Value& value) \ - : MapImpl(static_cast(from), value) { } \ -\ - EdgeMap(const EdgeMap& copy) \ - : MapImpl(static_cast(copy)) {} \ -\ - template \ - EdgeMap(const CMap& copy) \ - : MapImpl(copy) {} \ -\ - EdgeMap& operator=(const EdgeMap& copy) { \ - MapImpl::operator=(static_cast(copy)); \ - return *this; \ - } \ -\ - template \ - EdgeMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy); \ - return *this; \ - } \ +EdgeMap() : Parent() {} \ +EdgeMap(const To& to) \ + : Parent(static_cast(from)) { } \ +EdgeMap(const To& to, const Value& value) \ + : Parent(static_cast(from), value) { } \ +EdgeMap(const EdgeMap& copy) \ + : Parent(static_cast(copy)) {} \ +template \ +EdgeMap(const EdgeMap& copy) \ + : Parent(static_cast::Parent&>(copy)) {} \ +EdgeMap& operator=(const EdgeMap& copy) { \ + Parent::operator=(static_cast(copy)); \ + return *this; \ +} \ +template \ +EdgeMap& operator=(const EdgeMap& copy) { \ + Parent::operator=(static_cast::Parent&>(copy));\ + return *this; \ +} \ }; #define KEEP_EDGE_MAP(From, To) \