COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
09/03/04 17:32:03 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1093
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/default_map_factory.h

    r798 r799  
    77#include <hugo/vector_map_factory.h>
    88
     9///\ingroup graphmapfactory
     10///\file
     11///\brief Graph maps that construates and destruates
     12///their elements dynamically.
     13
    914namespace hugo {
     15
     16/// \addtogroup graphmapfactory
     17/// @{
    1018
    1119#define DEFAULT_MAP_BODY(Factory, Val) \
     
    1624  \
    1725    typedef typename MapRegistry::Graph Graph; \
    18     typedef typename MapRegistry::Key Key; \
     26    typedef typename MapRegistry::KeyType KeyType; \
    1927    typedef typename MapRegistry::KeyIt KeyIt; \
    2028    typedef Val Value; \
     
    96104  DEFAULT_MAP_BODY(VectorMapFactory, Type*);
    97105
     106
     107  /** The DefaultMapFactory template class is a factory class
     108   *  to create maps for the edge and nodes. This map factory
     109   *  uses the VectorMapFactory if the ValueType is a primitive
     110   *  type and the ArrayMapFactory for the other cases.
     111   *
     112   *  The template parameter is the MapRegistry that the maps
     113   *  will belong to.
     114   */
     115
    98116  template <typename MapRegistry>
    99117  class DefaultMapFactory {
    100118               
    101119  public:
    102                
     120    /// The graph type of the maps.
    103121    typedef typename MapRegistry::Graph Graph;
    104     typedef typename MapRegistry::Key Key;
     122    /// The key type of the maps.
     123    typedef typename MapRegistry::KeyType KeyType;
     124    /// The iterator to iterate on the keys.
    105125    typedef typename MapRegistry::KeyIt KeyIt;
    106126
     127    /// The MapBase of the Map which imlements the core regisitry function.
    107128    typedef typename MapRegistry::MapBase MapBase;
     129               
    108130
     131    /** The template Map type.
     132     */
    109133    template <typename V>
    110134    class Map : public DefaultMap<MapRegistry, V> {
     
    116140      typedef V Value;
    117141
     142      /** Default constructor for the map.
     143       */
    118144      Map() : MapImpl() {}
    119145
     146      /** Graph and Registry initialized map constructor.
     147       */
    120148      Map(const Graph& g, MapRegistry& r) : MapImpl(g, r) {}
    121149
     150      /** Constructor to use default value to initialize the map.
     151       */
    122152      Map(const Graph& g, MapRegistry& r, const Value& v) : MapImpl(g, r, v) {}
    123153
     154      /** Constructor to copy a map of the same map type.
     155       */
    124156      Map(const Map& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {}
    125157
     158      /** Constructor to copy a map of an other map type.
     159       */
    126160      template <typename CMap> Map(const CMap& copy) : MapImpl(copy) {}
    127161
     162      /** Assign operator to copy a map of the same map type.
     163       */
    128164      Map& operator=(const Map& copy) {
    129165        MapImpl::operator=(static_cast<const MapImpl&>(copy));
     
    131167      }
    132168
     169      /** Assign operator to copy a map an other map type.
     170       */
    133171      template <typename CMap> Map& operator=(const CMap& copy) {
    134172        MapImpl::operator=(copy);
Note: See TracChangeset for help on using the changeset viewer.