diff -r 4317d277ba21 -r 765619b7cbb2 lemon/bits/map_extender.h --- a/lemon/bits/map_extender.h Sun Jul 13 16:46:56 2008 +0100 +++ b/lemon/bits/map_extender.h Sun Jul 13 19:51:02 2008 +0100 @@ -1,6 +1,6 @@ -/* -*- C++ -*- +/* -*- mode: C++; indent-tabs-mode: nil; -*- * - * This file is a part of LEMON, a generic C++ optimization library + * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2008 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport @@ -32,7 +32,7 @@ namespace lemon { /// \ingroup graphbits - /// + /// /// \brief Extender for maps template class MapExtender : public _Map { @@ -56,10 +56,10 @@ public: - MapExtender(const Graph& graph) + MapExtender(const Graph& graph) : Parent(graph) {} - MapExtender(const Graph& graph, const Value& value) + MapExtender(const Graph& graph, const Value& value) : Parent(graph, value) {} MapExtender& operator=(const MapExtender& cmap) { @@ -70,14 +70,14 @@ MapExtender& operator=(const CMap& cmap) { Parent::operator=(cmap); return *this; - } + } class MapIt : public Item { public: - + typedef Item Parent; typedef typename Map::Value Value; - + MapIt() {} MapIt(Invalid i) : Parent(i) { } @@ -86,29 +86,29 @@ map.notifier()->first(*this); } - MapIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + MapIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - MapIt& operator++() { - map.notifier()->next(*this); - return *this; + MapIt& operator++() { + map.notifier()->next(*this); + return *this; } - + typename MapTraits::ConstReturnValue operator*() const { - return map[*this]; + return map[*this]; } typename MapTraits::ReturnValue operator*() { - return map[*this]; + return map[*this]; } - + void set(const Value& value) { - map.set(*this, value); + map.set(*this, value); } - + protected: Map& map; - + }; class ConstMapIt : public Item { @@ -117,7 +117,7 @@ typedef Item Parent; typedef typename Map::Value Value; - + ConstMapIt() {} ConstMapIt(Invalid i) : Parent(i) { } @@ -126,16 +126,16 @@ map.notifier()->first(*this); } - ConstMapIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + ConstMapIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - ConstMapIt& operator++() { - map.notifier()->next(*this); - return *this; + ConstMapIt& operator++() { + map.notifier()->next(*this); + return *this; } typename MapTraits::ConstReturnValue operator*() const { - return map[*this]; + return map[*this]; } protected: @@ -144,9 +144,9 @@ class ItemIt : public Item { public: - + typedef Item Parent; - + ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -155,22 +155,22 @@ map.notifier()->first(*this); } - ItemIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + ItemIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - ItemIt& operator++() { - map.notifier()->next(*this); - return *this; + ItemIt& operator++() { + map.notifier()->next(*this); + return *this; } protected: const Map& map; - + }; }; /// \ingroup graphbits - /// + /// /// \brief Extender for maps which use a subset of the items. template class SubMapExtender : public _Map { @@ -194,10 +194,10 @@ public: - SubMapExtender(const Graph& _graph) + SubMapExtender(const Graph& _graph) : Parent(_graph), graph(_graph) {} - SubMapExtender(const Graph& _graph, const Value& _value) + SubMapExtender(const Graph& _graph, const Value& _value) : Parent(_graph, _value), graph(_graph) {} SubMapExtender& operator=(const SubMapExtender& cmap) { @@ -212,14 +212,14 @@ Parent::set(it, cmap[it]); } return *this; - } + } class MapIt : public Item { public: - + typedef Item Parent; typedef typename Map::Value Value; - + MapIt() {} MapIt(Invalid i) : Parent(i) { } @@ -228,29 +228,29 @@ map.graph.first(*this); } - MapIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + MapIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - MapIt& operator++() { - map.graph.next(*this); - return *this; + MapIt& operator++() { + map.graph.next(*this); + return *this; } - + typename MapTraits::ConstReturnValue operator*() const { - return map[*this]; + return map[*this]; } typename MapTraits::ReturnValue operator*() { - return map[*this]; + return map[*this]; } - + void set(const Value& value) { - map.set(*this, value); + map.set(*this, value); } - + protected: Map& map; - + }; class ConstMapIt : public Item { @@ -259,7 +259,7 @@ typedef Item Parent; typedef typename Map::Value Value; - + ConstMapIt() {} ConstMapIt(Invalid i) : Parent(i) { } @@ -268,16 +268,16 @@ map.graph.first(*this); } - ConstMapIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + ConstMapIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - ConstMapIt& operator++() { - map.graph.next(*this); - return *this; + ConstMapIt& operator++() { + map.graph.next(*this); + return *this; } typename MapTraits::ConstReturnValue operator*() const { - return map[*this]; + return map[*this]; } protected: @@ -286,9 +286,9 @@ class ItemIt : public Item { public: - + typedef Item Parent; - + ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -297,23 +297,23 @@ map.graph.first(*this); } - ItemIt(const Map& _map, const Item& item) - : Parent(item), map(_map) {} + ItemIt(const Map& _map, const Item& item) + : Parent(item), map(_map) {} - ItemIt& operator++() { - map.graph.next(*this); - return *this; + ItemIt& operator++() { + map.graph.next(*this); + return *this; } protected: const Map& map; - + }; - + private: const Graph& graph; - + }; }