diff -r 64f8f7cc6168 -r 2cc60866a0c9 lemon/bits/array_map.h --- a/lemon/bits/array_map.h Thu Oct 09 10:09:44 2008 +0200 +++ b/lemon/bits/array_map.h Thu Oct 09 13:27:35 2008 +0200 @@ -26,48 +26,48 @@ #include #include -/// \ingroup graphbits -/// \file -/// \brief Graph map based on the array storage. +// \ingroup graphbits +// \file +// \brief Graph map based on the array storage. namespace lemon { - /// \ingroup graphbits - /// - /// \brief Graph map based on the array storage. - /// - /// The ArrayMap template class is graph map structure what - /// automatically updates the map when a key is added to or erased from - /// the map. This map uses the allocators to implement - /// the container functionality. - /// - /// The template parameters are the Graph the current Item type and - /// the Value type of the map. + // \ingroup graphbits + // + // \brief Graph map based on the array storage. + // + // The ArrayMap template class is graph map structure what + // automatically updates the map when a key is added to or erased from + // the map. This map uses the allocators to implement + // the container functionality. + // + // The template parameters are the Graph the current Item type and + // the Value type of the map. template class ArrayMap : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase { public: - /// The graph type of the maps. + // The graph type of the maps. typedef _Graph Graph; - /// The item type of the map. + // The item type of the map. typedef _Item Item; - /// The reference map tag. + // The reference map tag. typedef True ReferenceMapTag; - /// The key type of the maps. + // The key type of the maps. typedef _Item Key; - /// The value type of the map. + // The value type of the map. typedef _Value Value; - /// The const reference type of the map. + // The const reference type of the map. typedef const _Value& ConstReference; - /// The reference type of the map. + // The reference type of the map. typedef _Value& Reference; - /// The notifier type. + // The notifier type. typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier; - /// The MapBase of the Map which imlements the core regisitry function. + // The MapBase of the Map which imlements the core regisitry function. typedef typename Notifier::ObserverBase Parent; private: @@ -75,9 +75,9 @@ public: - /// \brief Graph initialized map constructor. - /// - /// Graph initialized map constructor. + // \brief Graph initialized map constructor. + // + // Graph initialized map constructor. explicit ArrayMap(const Graph& graph) { Parent::attach(graph.notifier(Item())); allocate_memory(); @@ -89,9 +89,9 @@ } } - /// \brief Constructor to use default value to initialize the map. - /// - /// It constructs a map and initialize all of the the map. + // \brief Constructor to use default value to initialize the map. + // + // It constructs a map and initialize all of the the map. ArrayMap(const Graph& graph, const Value& value) { Parent::attach(graph.notifier(Item())); allocate_memory(); @@ -104,9 +104,9 @@ } private: - /// \brief Constructor to copy a map of the same map type. - /// - /// Constructor to copy a map of the same map type. + // \brief Constructor to copy a map of the same map type. + // + // Constructor to copy a map of the same map type. ArrayMap(const ArrayMap& copy) : Parent() { if (copy.attached()) { attach(*copy.notifier()); @@ -122,24 +122,24 @@ } } - /// \brief Assign operator. - /// - /// This operator assigns for each item in the map the - /// value mapped to the same item in the copied map. - /// The parameter map should be indiced with the same - /// itemset because this assign operator does not change - /// the container of the map. + // \brief Assign operator. + // + // This operator assigns for each item in the map the + // value mapped to the same item in the copied map. + // The parameter map should be indiced with the same + // itemset because this assign operator does not change + // the container of the map. ArrayMap& operator=(const ArrayMap& cmap) { return operator=(cmap); } - /// \brief Template assign operator. - /// - /// The given parameter should be conform to the ReadMap - /// concecpt and could be indiced by the current item set of - /// the NodeMap. In this case the value for each item - /// is assigned by the value of the given ReadMap. + // \brief Template assign operator. + // + // The given parameter should be conform to the ReadMap + // concecpt and could be indiced by the current item set of + // the NodeMap. In this case the value for each item + // is assigned by the value of the given ReadMap. template ArrayMap& operator=(const CMap& cmap) { checkConcept, CMap>(); @@ -152,9 +152,9 @@ } public: - /// \brief The destructor of the map. - /// - /// The destructor of the map. + // \brief The destructor of the map. + // + // The destructor of the map. virtual ~ArrayMap() { if (attached()) { clear(); @@ -170,38 +170,38 @@ public: - /// \brief The subscript operator. - /// - /// The subscript operator. The map can be subscripted by the - /// actual keys of the graph. + // \brief The subscript operator. + // + // The subscript operator. The map can be subscripted by the + // actual keys of the graph. Value& operator[](const Key& key) { int id = Parent::notifier()->id(key); return values[id]; } - /// \brief The const subscript operator. - /// - /// The const subscript operator. The map can be subscripted by the - /// actual keys of the graph. + // \brief The const subscript operator. + // + // The const subscript operator. The map can be subscripted by the + // actual keys of the graph. const Value& operator[](const Key& key) const { int id = Parent::notifier()->id(key); return values[id]; } - /// \brief Setter function of the map. - /// - /// Setter function of the map. Equivalent with map[key] = val. - /// This is a compatibility feature with the not dereferable maps. + // \brief Setter function of the map. + // + // Setter function of the map. Equivalent with map[key] = val. + // This is a compatibility feature with the not dereferable maps. void set(const Key& key, const Value& val) { (*this)[key] = val; } protected: - /// \brief Adds a new key to the map. - /// - /// It adds a new key to the map. It called by the observer notifier - /// and it overrides the add() member function of the observer base. + // \brief Adds a new key to the map. + // + // It adds a new key to the map. It called by the observer notifier + // and it overrides the add() member function of the observer base. virtual void add(const Key& key) { Notifier* nf = Parent::notifier(); int id = nf->id(key); @@ -226,10 +226,10 @@ allocator.construct(&(values[id]), Value()); } - /// \brief Adds more new keys to the map. - /// - /// It adds more new keys to the map. It called by the observer notifier - /// and it overrides the add() member function of the observer base. + // \brief Adds more new keys to the map. + // + // It adds more new keys to the map. It called by the observer notifier + // and it overrides the add() member function of the observer base. virtual void add(const std::vector& keys) { Notifier* nf = Parent::notifier(); int max_id = -1; @@ -270,19 +270,19 @@ } } - /// \brief Erase a key from the map. - /// - /// Erase a key from the map. It called by the observer notifier - /// and it overrides the erase() member function of the observer base. + // \brief Erase a key from the map. + // + // Erase a key from the map. It called by the observer notifier + // and it overrides the erase() member function of the observer base. virtual void erase(const Key& key) { int id = Parent::notifier()->id(key); allocator.destroy(&(values[id])); } - /// \brief Erase more keys from the map. - /// - /// Erase more keys from the map. It called by the observer notifier - /// and it overrides the erase() member function of the observer base. + // \brief Erase more keys from the map. + // + // Erase more keys from the map. It called by the observer notifier + // and it overrides the erase() member function of the observer base. virtual void erase(const std::vector& keys) { for (int i = 0; i < int(keys.size()); ++i) { int id = Parent::notifier()->id(keys[i]); @@ -290,10 +290,10 @@ } } - /// \brief Buildes the map. - /// - /// It buildes the map. It called by the observer notifier - /// and it overrides the build() member function of the observer base. + // \brief Buildes the map. + // + // It buildes the map. It called by the observer notifier + // and it overrides the build() member function of the observer base. virtual void build() { Notifier* nf = Parent::notifier(); allocate_memory(); @@ -304,10 +304,10 @@ } } - /// \brief Clear the map. - /// - /// It erase all items from the map. It called by the observer notifier - /// and it overrides the clear() member function of the observer base. + // \brief Clear the map. + // + // It erase all items from the map. It called by the observer notifier + // and it overrides the clear() member function of the observer base. virtual void clear() { Notifier* nf = Parent::notifier(); if (capacity != 0) {