lemon/concepts/graph_components.h
changeset 316 689f24ee83e6
parent 220 a5d8c039f218
child 313 64f8f7cc6168
equal deleted inserted replaced
5:de727782aa96 6:5fd6fbfea1cf
  1003       explicit GraphMap(const Graph&) {}
  1003       explicit GraphMap(const Graph&) {}
  1004       /// \brief Construct a new map with default value.
  1004       /// \brief Construct a new map with default value.
  1005       ///
  1005       ///
  1006       /// Construct a new map for the graph and initalise the values.
  1006       /// Construct a new map for the graph and initalise the values.
  1007       GraphMap(const Graph&, const Value&) {}
  1007       GraphMap(const Graph&, const Value&) {}
       
  1008 
       
  1009     private:
  1008       /// \brief Copy constructor.
  1010       /// \brief Copy constructor.
  1009       ///
  1011       ///
  1010       /// Copy Constructor.
  1012       /// Copy Constructor.
  1011       GraphMap(const GraphMap&) : Parent() {}
  1013       GraphMap(const GraphMap&) : Parent() {}
  1012 
  1014 
  1019       GraphMap& operator=(const CMap&) {
  1021       GraphMap& operator=(const CMap&) {
  1020         checkConcept<ReadMap<Key, Value>, CMap>();
  1022         checkConcept<ReadMap<Key, Value>, CMap>();
  1021         return *this;
  1023         return *this;
  1022       }
  1024       }
  1023 
  1025 
       
  1026     public:
  1024       template<typename _Map>
  1027       template<typename _Map>
  1025       struct Constraints {
  1028       struct Constraints {
  1026         void constraints() {
  1029         void constraints() {
  1027           checkConcept<ReadWriteMap<Key, Value>, _Map >();
  1030           checkConcept<ReadWriteMap<Key, Value>, _Map >();
  1028           // Construction with a graph parameter
  1031           // Construction with a graph parameter
  1029           _Map a(g);
  1032           _Map a(g);
  1030           // Constructor with a graph and a default value parameter
  1033           // Constructor with a graph and a default value parameter
  1031           _Map a2(g,t);
  1034           _Map a2(g,t);
  1032           // Copy constructor.
  1035           // Copy constructor.
  1033           _Map b(c);
  1036           // _Map b(c);
  1034 
  1037 
  1035           ReadMap<Key, Value> cmap;
  1038           // ReadMap<Key, Value> cmap;
  1036           b = cmap;
  1039           // b = cmap;
  1037 
  1040 
       
  1041           ignore_unused_variable_warning(a);
  1038           ignore_unused_variable_warning(a2);
  1042           ignore_unused_variable_warning(a2);
  1039           ignore_unused_variable_warning(b);
  1043           // ignore_unused_variable_warning(b);
  1040         }
  1044         }
  1041 
  1045 
  1042         const _Map &c;
  1046         const _Map &c;
  1043         const Graph &g;
  1047         const Graph &g;
  1044         const typename GraphMap::Value &t;
  1048         const typename GraphMap::Value &t;
  1080         ///
  1084         ///
  1081         /// Construct a new map for the digraph and initalise the values.
  1085         /// Construct a new map for the digraph and initalise the values.
  1082         NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
  1086         NodeMap(const MappableDigraphComponent& digraph, const _Value& value)
  1083           : Parent(digraph, value) {}
  1087           : Parent(digraph, value) {}
  1084 
  1088 
       
  1089       private:
  1085         /// \brief Copy constructor.
  1090         /// \brief Copy constructor.
  1086         ///
  1091         ///
  1087         /// Copy Constructor.
  1092         /// Copy Constructor.
  1088         NodeMap(const NodeMap& nm) : Parent(nm) {}
  1093         NodeMap(const NodeMap& nm) : Parent(nm) {}
  1089 
  1094 
  1117         ///
  1122         ///
  1118         /// Construct a new map for the digraph and initalise the values.
  1123         /// Construct a new map for the digraph and initalise the values.
  1119         ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
  1124         ArcMap(const MappableDigraphComponent& digraph, const _Value& value)
  1120           : Parent(digraph, value) {}
  1125           : Parent(digraph, value) {}
  1121 
  1126 
       
  1127       private:
  1122         /// \brief Copy constructor.
  1128         /// \brief Copy constructor.
  1123         ///
  1129         ///
  1124         /// Copy Constructor.
  1130         /// Copy Constructor.
  1125         ArcMap(const ArcMap& nm) : Parent(nm) {}
  1131         ArcMap(const ArcMap& nm) : Parent(nm) {}
  1126 
  1132 
  1213         ///
  1219         ///
  1214         /// Construct a new map for the graph and initalise the values.
  1220         /// Construct a new map for the graph and initalise the values.
  1215         EdgeMap(const MappableGraphComponent& graph, const _Value& value)
  1221         EdgeMap(const MappableGraphComponent& graph, const _Value& value)
  1216           : Parent(graph, value) {}
  1222           : Parent(graph, value) {}
  1217 
  1223 
       
  1224       private:
  1218         /// \brief Copy constructor.
  1225         /// \brief Copy constructor.
  1219         ///
  1226         ///
  1220         /// Copy Constructor.
  1227         /// Copy Constructor.
  1221         EdgeMap(const EdgeMap& nm) : Parent(nm) {}
  1228         EdgeMap(const EdgeMap& nm) : Parent(nm) {}
  1222 
  1229