diff -r 3a48bc350e0f -r 74589d20dbc3 src/hugo/default_map.h --- a/src/hugo/default_map.h Mon Sep 20 17:53:33 2004 +0000 +++ b/src/hugo/default_map.h Mon Sep 20 22:57:48 2004 +0000 @@ -29,36 +29,48 @@ /** Macro to implement the DefaultMap. */ #define DEFAULT_MAP_BODY(DynMap, Value) \ - { \ - typedef DynMap MapImpl; \ - \ - public: \ - \ - typedef typename MapRegistry::Graph Graph; \ - \ - DefaultMap() : MapImpl() {} \ - \ - DefaultMap(const Graph& g, MapRegistry& r) : MapImpl(g, r) {} \ - \ - DefaultMap(const Graph& g, MapRegistry& r, const Value& v) \ - : MapImpl(g, r, v) {} \ - \ - DefaultMap(const DefaultMap& copy) \ - : MapImpl(static_cast(copy)) {} \ - \ - template DefaultMap(const CMap& copy) : MapImpl(copy) {} \ - \ - DefaultMap& operator=(const DefaultMap& copy) { \ - MapImpl::operator=(static_cast(copy)); \ - return *this; \ +{ \ +\ +public: \ +\ +typedef DynMap Parent; \ +\ +typedef typename MapRegistry::Graph Graph; \ +\ +DefaultMap() : Parent() {} \ +DefaultMap(const Graph& g, MapRegistry& r) : Parent(g, r) {} \ +DefaultMap(const Graph& g, MapRegistry& r, const Value& v) \ + : Parent(g, r, v) {} \ +DefaultMap(const DefaultMap& copy) \ + : Parent(static_cast(copy)) {} \ +template \ +DefaultMap(const DefaultMap& copy) { \ + Parent::MapBase::operator= \ + (static_cast(copy)); \ + if (Parent::getGraph()) { \ + for (typename Parent::KeyIt it(*Parent::getGraph()); it!=INVALID; ++it) {\ + Parent::add(it); \ + Parent::operator[](it) = copy[it]; \ } \ - \ - template DefaultMap& operator=(const CMap& copy) { \ - MapImpl::operator=(copy); \ - return *this; \ + } \ +} \ +DefaultMap& operator=(const DefaultMap& copy) { \ + Parent::operator=(static_cast(copy)); \ + return *this; \ +} \ +template \ +DefaultMap& operator=(const DefaultMap& copy) { \ + Parent::clear(); \ + Parent::MapBase::operator=(copy); \ + if (Parent::getGraph()) { \ + for (typename Parent::KeyIt it(*Parent::getGraph()); it!=INVALID; ++it) {\ + Parent::add(it); \ + Parent::operator[](it) = copy[it]; \ } \ - \ - }; + } \ + return *this; \ +} \ +}; template