COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/array_map.h

    r314 r263  
    2727#include <lemon/concepts/maps.h>
    2828
    29 // \ingroup graphbits
    30 // \file
    31 // \brief Graph map based on the array storage.
     29/// \ingroup graphbits
     30/// \file
     31/// \brief Graph map based on the array storage.
    3232
    3333namespace lemon {
    3434
    35   // \ingroup graphbits
    36   //
    37   // \brief Graph map based on the array storage.
    38   //
    39   // The ArrayMap template class is graph map structure what
    40   // automatically updates the map when a key is added to or erased from
    41   // the map. This map uses the allocators to implement
    42   // the container functionality.
    43   //
    44   // The template parameters are the Graph the current Item type and
    45   // the Value type of the map.
     35  /// \ingroup graphbits
     36  ///
     37  /// \brief Graph map based on the array storage.
     38  ///
     39  /// The ArrayMap template class is graph map structure what
     40  /// automatically updates the map when a key is added to or erased from
     41  /// the map. This map uses the allocators to implement
     42  /// the container functionality.
     43  ///
     44  /// The template parameters are the Graph the current Item type and
     45  /// the Value type of the map.
    4646  template <typename _Graph, typename _Item, typename _Value>
    4747  class ArrayMap
    4848    : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase {
    4949  public:
    50     // The graph type of the maps.
     50    /// The graph type of the maps.
    5151    typedef _Graph Graph;
    52     // The item type of the map.
     52    /// The item type of the map.
    5353    typedef _Item Item;
    54     // The reference map tag.
     54    /// The reference map tag.
    5555    typedef True ReferenceMapTag;
    5656
    57     // The key type of the maps.
     57    /// The key type of the maps.
    5858    typedef _Item Key;
    59     // The value type of the map.
     59    /// The value type of the map.
    6060    typedef _Value Value;
    6161
    62     // The const reference type of the map.
     62    /// The const reference type of the map.
    6363    typedef const _Value& ConstReference;
    64     // The reference type of the map.
     64    /// The reference type of the map.
    6565    typedef _Value& Reference;
    6666
    67     // The notifier type.
     67    /// The notifier type.
    6868    typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
    6969
    70     // The MapBase of the Map which imlements the core regisitry function.
     70    /// The MapBase of the Map which imlements the core regisitry function.
    7171    typedef typename Notifier::ObserverBase Parent;
    7272
     
    7676  public:
    7777
    78     // \brief Graph initialized map constructor.
    79     //
    80     // Graph initialized map constructor.
     78    /// \brief Graph initialized map constructor.
     79    ///
     80    /// Graph initialized map constructor.
    8181    explicit ArrayMap(const Graph& graph) {
    8282      Parent::attach(graph.notifier(Item()));
     
    9090    }
    9191
    92     // \brief Constructor to use default value to initialize the map.
    93     //
    94     // It constructs a map and initialize all of the the map.
     92    /// \brief Constructor to use default value to initialize the map.
     93    ///
     94    /// It constructs a map and initialize all of the the map.
    9595    ArrayMap(const Graph& graph, const Value& value) {
    9696      Parent::attach(graph.notifier(Item()));
     
    105105
    106106  private:
    107     // \brief Constructor to copy a map of the same map type.
    108     //
    109     // Constructor to copy a map of the same map type.
     107    /// \brief Constructor to copy a map of the same map type.
     108    ///
     109    /// Constructor to copy a map of the same map type.
    110110    ArrayMap(const ArrayMap& copy) : Parent() {
    111111      if (copy.attached()) {
     
    123123    }
    124124
    125     // \brief Assign operator.
    126     //
    127     // This operator assigns for each item in the map the
    128     // value mapped to the same item in the copied map.
    129     // The parameter map should be indiced with the same
    130     // itemset because this assign operator does not change
    131     // the container of the map.
     125    /// \brief Assign operator.
     126    ///
     127    /// This operator assigns for each item in the map the
     128    /// value mapped to the same item in the copied map.
     129    /// The parameter map should be indiced with the same
     130    /// itemset because this assign operator does not change
     131    /// the container of the map.
    132132    ArrayMap& operator=(const ArrayMap& cmap) {
    133133      return operator=<ArrayMap>(cmap);
     
    135135
    136136
    137     // \brief Template assign operator.
    138     //
    139     // The given parameter should be conform to the ReadMap
    140     // concecpt and could be indiced by the current item set of
    141     // the NodeMap. In this case the value for each item
    142     // is assigned by the value of the given ReadMap.
     137    /// \brief Template assign operator.
     138    ///
     139    /// The given parameter should be conform to the ReadMap
     140    /// concecpt and could be indiced by the current item set of
     141    /// the NodeMap. In this case the value for each item
     142    /// is assigned by the value of the given ReadMap.
    143143    template <typename CMap>
    144144    ArrayMap& operator=(const CMap& cmap) {
     
    153153
    154154  public:
    155     // \brief The destructor of the map.
    156     //
    157     // The destructor of the map.
     155    /// \brief The destructor of the map.
     156    ///
     157    /// The destructor of the map.
    158158    virtual ~ArrayMap() {
    159159      if (attached()) {
     
    171171  public:
    172172
    173     // \brief The subscript operator.
    174     //
    175     // The subscript operator. The map can be subscripted by the
    176     // actual keys of the graph.
     173    /// \brief The subscript operator.
     174    ///
     175    /// The subscript operator. The map can be subscripted by the
     176    /// actual keys of the graph.
    177177    Value& operator[](const Key& key) {
    178178      int id = Parent::notifier()->id(key);
     
    180180    }
    181181
    182     // \brief The const subscript operator.
    183     //
    184     // The const subscript operator. The map can be subscripted by the
    185     // actual keys of the graph.
     182    /// \brief The const subscript operator.
     183    ///
     184    /// The const subscript operator. The map can be subscripted by the
     185    /// actual keys of the graph.
    186186    const Value& operator[](const Key& key) const {
    187187      int id = Parent::notifier()->id(key);
     
    189189    }
    190190
    191     // \brief Setter function of the map.
    192     //
    193     // Setter function of the map. Equivalent with map[key] = val.
    194     // This is a compatibility feature with the not dereferable maps.
     191    /// \brief Setter function of the map.
     192    ///
     193    /// Setter function of the map. Equivalent with map[key] = val.
     194    /// This is a compatibility feature with the not dereferable maps.
    195195    void set(const Key& key, const Value& val) {
    196196      (*this)[key] = val;
     
    199199  protected:
    200200
    201     // \brief Adds a new key to the map.
    202     //
    203     // It adds a new key to the map. It called by the observer notifier
    204     // and it overrides the add() member function of the observer base.
     201    /// \brief Adds a new key to the map.
     202    ///
     203    /// It adds a new key to the map. It called by the observer notifier
     204    /// and it overrides the add() member function of the observer base.
    205205    virtual void add(const Key& key) {
    206206      Notifier* nf = Parent::notifier();
     
    227227    }
    228228
    229     // \brief Adds more new keys to the map.
    230     //
    231     // It adds more new keys to the map. It called by the observer notifier
    232     // and it overrides the add() member function of the observer base.
     229    /// \brief Adds more new keys to the map.
     230    ///
     231    /// It adds more new keys to the map. It called by the observer notifier
     232    /// and it overrides the add() member function of the observer base.
    233233    virtual void add(const std::vector<Key>& keys) {
    234234      Notifier* nf = Parent::notifier();
     
    271271    }
    272272
    273     // \brief Erase a key from the map.
    274     //
    275     // Erase a key from the map. It called by the observer notifier
    276     // and it overrides the erase() member function of the observer base.
     273    /// \brief Erase a key from the map.
     274    ///
     275    /// Erase a key from the map. It called by the observer notifier
     276    /// and it overrides the erase() member function of the observer base.
    277277    virtual void erase(const Key& key) {
    278278      int id = Parent::notifier()->id(key);
     
    280280    }
    281281
    282     // \brief Erase more keys from the map.
    283     //
    284     // Erase more keys from the map. It called by the observer notifier
    285     // and it overrides the erase() member function of the observer base.
     282    /// \brief Erase more keys from the map.
     283    ///
     284    /// Erase more keys from the map. It called by the observer notifier
     285    /// and it overrides the erase() member function of the observer base.
    286286    virtual void erase(const std::vector<Key>& keys) {
    287287      for (int i = 0; i < int(keys.size()); ++i) {
     
    291291    }
    292292
    293     // \brief Buildes the map.
    294     //
    295     // It buildes the map. It called by the observer notifier
    296     // and it overrides the build() member function of the observer base.
     293    /// \brief Buildes the map.
     294    ///
     295    /// It buildes the map. It called by the observer notifier
     296    /// and it overrides the build() member function of the observer base.
    297297    virtual void build() {
    298298      Notifier* nf = Parent::notifier();
     
    305305    }
    306306
    307     // \brief Clear the map.
    308     //
    309     // It erase all items from the map. It called by the observer notifier
    310     // and it overrides the clear() member function of the observer base.
     307    /// \brief Clear the map.
     308    ///
     309    /// It erase all items from the map. It called by the observer notifier
     310    /// and it overrides the clear() member function of the observer base.
    311311    virtual void clear() {
    312312      Notifier* nf = Parent::notifier();
Note: See TracChangeset for help on using the changeset viewer.