lemon/bits/default_map.h
changeset 2018 66a1f0950700
parent 1996 5dc13b93f8b4
child 2031 080d51024ac5
equal deleted inserted replaced
16:12acf3ea8cc2 17:c74d0a46c1c9
    14  * express or implied, and with no claim as to its suitability for any
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    15  * purpose.
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 #ifndef LEMON_DEFAULT_MAP_H
    19 #ifndef LEMON_BITS_DEFAULT_MAP_H
    20 #define LEMON_DEFAULT_MAP_H
    20 #define LEMON_BITS_DEFAULT_MAP_H
    21 
    21 
    22 
    22 
    23 #include <lemon/bits/array_map.h>
    23 #include <lemon/bits/array_map.h>
    24 #include <lemon/bits/vector_map.h>
    24 #include <lemon/bits/vector_map.h>
    25 #include <lemon/bits/static_map.h>
       
    26 
    25 
    27 ///\ingroup graphbits
    26 ///\ingroup graphbits
    28 ///\file
    27 ///\file
    29 ///\brief Graph maps that construct and destruct
    28 ///\brief Graph maps that construct and destruct their elements dynamically.
    30 ///their elements dynamically.
       
    31 
    29 
    32 namespace lemon {
    30 namespace lemon {
    33   
    31   
    34   
    32   
    35 #ifndef _GLIBCXX_DEBUG
    33 #ifndef _GLIBCXX_DEBUG
   149   struct DefaultMapSelector<_Graph, _Item, _Ptr*> {
   147   struct DefaultMapSelector<_Graph, _Item, _Ptr*> {
   150     typedef VectorMap<_Graph, _Item, _Ptr*> Map;
   148     typedef VectorMap<_Graph, _Item, _Ptr*> Map;
   151   };
   149   };
   152 
   150 
   153   /// \e
   151   /// \e
   154   template <
   152   template <typename _Graph, typename _Item, typename _Value>
   155     typename _Graph, 
       
   156     typename _Item,
       
   157     typename _Value>
       
   158   class DefaultMap 
   153   class DefaultMap 
   159     : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
   154     : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
   160   public:
   155   public:
   161     typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
   156     typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
   162     typedef DefaultMap<_Graph, _Item, _Value> Map;
   157     typedef DefaultMap<_Graph, _Item, _Value> Map;
   163     
   158     
   164     typedef typename Parent::Graph Graph;
   159     typedef typename Parent::Graph Graph;
   165     typedef typename Parent::Value Value;
   160     typedef typename Parent::Value Value;
   166 
   161 
   167     DefaultMap(const Graph& _g) : Parent(_g) {}
   162     DefaultMap(const Graph& graph) : Parent(graph) {}
   168     DefaultMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {}
   163     DefaultMap(const Graph& graph, const Value& value) 
       
   164       : Parent(graph, value) {}
   169 
   165 
   170   };
   166   };
   171 
   167 
   172 }
   168 }
   173 
   169