COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
04/14/09 10:34:12 (11 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Standard graph maps are required to be reference maps (#190)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concepts/graph_components.h

    r626 r627  
    989989    /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and
    990990    /// graph types, which can be used for associating data to graph items.
     991    /// The standard graph maps must conform to the ReferenceMap concept.
    991992    template <typename GR, typename K, typename V>
    992     class GraphMap : public ReadWriteMap<K, V> {
     993    class GraphMap : public ReferenceMap<K, V, V&, const V&> {
    993994    public:
    994995
     
    10011002      /// The value type of the map.
    10021003      typedef V Value;
     1004      /// The reference type of the map.
     1005      typedef Value& Reference;
     1006      /// The const reference type of the map.
     1007      typedef const Value& ConstReference;
     1008
     1009      // The reference map tag.
     1010      typedef True ReferenceMapTag;
    10031011
    10041012      /// \brief Construct a new map.
     
    10321040      struct Constraints {
    10331041        void constraints() {
    1034           checkConcept<ReadWriteMap<Key, Value>, _Map >();
     1042          checkConcept
     1043            <ReferenceMap<Key, Value, Value&, const Value&>, _Map>();
    10351044          _Map m1(g);
    10361045          _Map m2(g,t);
     
    10741083      ///
    10751084      /// Standard graph map for the nodes.
     1085      /// It conforms to the ReferenceMap concept.
    10761086      template <typename V>
    10771087      class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
     
    11111121      ///
    11121122      /// Standard graph map for the arcs.
     1123      /// It conforms to the ReferenceMap concept.
    11131124      template <typename V>
    11141125      class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
     
    12081219      ///
    12091220      /// Standard graph map for the edges.
     1221      /// It conforms to the ReferenceMap concept.
    12101222      template <typename V>
    12111223      class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
Note: See TracChangeset for help on using the changeset viewer.