lemon/concept/graph_components.h
changeset 2198 416b0c06b5c8
parent 2129 43849d6e280a
child 2231 06faf3f06d67
equal deleted inserted replaced
1:6cbb75751fb4 2:88bc79d2eb76
  1292 
  1292 
  1293       /// \brief ReadWrite map of the nodes.
  1293       /// \brief ReadWrite map of the nodes.
  1294       ///
  1294       ///
  1295       /// ReadWrite map of the nodes.
  1295       /// ReadWrite map of the nodes.
  1296       ///
  1296       ///
  1297       template <typename Value>
  1297       template <typename _Value>
  1298       class NodeMap : public GraphMap<Graph, Node, Value> {
  1298       class NodeMap : public GraphMap<Graph, Node, _Value> {
  1299       private:
  1299       private:
  1300 	NodeMap();
  1300 	NodeMap();
  1301       public:
  1301       public:
  1302         typedef GraphMap<Graph, Node, Value> Parent;
  1302         typedef GraphMap<MappableGraphComponent, Node, _Value> Parent;
  1303 
  1303 
  1304 	/// \brief Construct a new map.
  1304 	/// \brief Construct a new map.
  1305 	///
  1305 	///
  1306 	/// Construct a new map for the graph.
  1306 	/// Construct a new map for the graph.
  1307 	/// \todo call the right parent class constructor
  1307 	/// \todo call the right parent class constructor
  1308 	explicit NodeMap(const Graph& graph) : Parent(graph) {}
  1308 	explicit NodeMap(const MappableGraphComponent& graph) 
       
  1309           : Parent(graph) {}
  1309 
  1310 
  1310 	/// \brief Construct a new map with default value.
  1311 	/// \brief Construct a new map with default value.
  1311 	///
  1312 	///
  1312 	/// Construct a new map for the graph and initalise the values.
  1313 	/// Construct a new map for the graph and initalise the values.
  1313 	NodeMap(const Graph& graph, const Value& value)
  1314 	NodeMap(const MappableGraphComponent& graph, const _Value& value)
  1314           : Parent(graph, value) {}
  1315           : Parent(graph, value) {}
  1315 
  1316 
  1316 	/// \brief Copy constructor.
  1317 	/// \brief Copy constructor.
  1317 	///
  1318 	///
  1318 	/// Copy Constructor.
  1319 	/// Copy Constructor.
  1321 	/// \brief Assign operator.
  1322 	/// \brief Assign operator.
  1322 	///
  1323 	///
  1323 	/// Assign operator.
  1324 	/// Assign operator.
  1324         template <typename CMap>
  1325         template <typename CMap>
  1325         NodeMap& operator=(const CMap&) { 
  1326         NodeMap& operator=(const CMap&) { 
  1326           checkConcept<ReadMap<Node, Value>, CMap>();
  1327           checkConcept<ReadMap<Node, _Value>, CMap>();
  1327           return *this;
  1328           return *this;
  1328         }
  1329         }
  1329 
  1330 
  1330       };
  1331       };
  1331 
  1332 
  1332       /// \brief ReadWrite map of the edges.
  1333       /// \brief ReadWrite map of the edges.
  1333       ///
  1334       ///
  1334       /// ReadWrite map of the edges.
  1335       /// ReadWrite map of the edges.
  1335       ///
  1336       ///
  1336       template <typename Value>
  1337       template <typename _Value>
  1337       class EdgeMap : public GraphMap<Graph, Edge, Value> {
  1338       class EdgeMap : public GraphMap<Graph, Edge, _Value> {
  1338       private:
  1339       private:
  1339 	EdgeMap();
  1340 	EdgeMap();
  1340       public:
  1341       public:
  1341         typedef GraphMap<Graph, Edge, Value> Parent;
  1342         typedef GraphMap<MappableGraphComponent, Edge, _Value> Parent;
  1342 
  1343 
  1343 	/// \brief Construct a new map.
  1344 	/// \brief Construct a new map.
  1344 	///
  1345 	///
  1345 	/// Construct a new map for the graph.
  1346 	/// Construct a new map for the graph.
  1346 	/// \todo call the right parent class constructor
  1347 	/// \todo call the right parent class constructor
  1347 	explicit EdgeMap(const Graph& graph) : Parent(graph) {}
  1348 	explicit EdgeMap(const MappableGraphComponent& graph) 
       
  1349           : Parent(graph) {}
  1348 
  1350 
  1349 	/// \brief Construct a new map with default value.
  1351 	/// \brief Construct a new map with default value.
  1350 	///
  1352 	///
  1351 	/// Construct a new map for the graph and initalise the values.
  1353 	/// Construct a new map for the graph and initalise the values.
  1352 	EdgeMap(const Graph& graph, const Value& value)
  1354 	EdgeMap(const MappableGraphComponent& graph, const _Value& value)
  1353           : Parent(graph, value) {}
  1355           : Parent(graph, value) {}
  1354 
  1356 
  1355 	/// \brief Copy constructor.
  1357 	/// \brief Copy constructor.
  1356 	///
  1358 	///
  1357 	/// Copy Constructor.
  1359 	/// Copy Constructor.
  1360 	/// \brief Assign operator.
  1362 	/// \brief Assign operator.
  1361 	///
  1363 	///
  1362 	/// Assign operator.
  1364 	/// Assign operator.
  1363         template <typename CMap>
  1365         template <typename CMap>
  1364         EdgeMap& operator=(const CMap&) { 
  1366         EdgeMap& operator=(const CMap&) { 
  1365           checkConcept<ReadMap<Edge, Value>, CMap>();
  1367           checkConcept<ReadMap<Edge, _Value>, CMap>();
  1366           return *this;
  1368           return *this;
  1367         }
  1369         }
  1368 
  1370 
  1369       };
  1371       };
  1370 
  1372 
  1429 
  1431 
  1430       /// \brief ReadWrite map of the uedges.
  1432       /// \brief ReadWrite map of the uedges.
  1431       ///
  1433       ///
  1432       /// ReadWrite map of the uedges.
  1434       /// ReadWrite map of the uedges.
  1433       ///
  1435       ///
  1434       template <typename Value>
  1436       template <typename _Value>
  1435       class UEdgeMap : public GraphMap<Graph, UEdge, Value> {  
  1437       class UEdgeMap : public GraphMap<Graph, UEdge, _Value> {  
  1436       public:
  1438       public:
  1437         typedef GraphMap<Graph, UEdge, Value> Parent;
  1439         typedef GraphMap<MappableUGraphComponent, UEdge, _Value> Parent;
  1438 
  1440 
  1439 	/// \brief Construct a new map.
  1441 	/// \brief Construct a new map.
  1440 	///
  1442 	///
  1441 	/// Construct a new map for the graph.
  1443 	/// Construct a new map for the graph.
  1442 	/// \todo call the right parent class constructor
  1444 	/// \todo call the right parent class constructor
  1443 	explicit UEdgeMap(const Graph& graph) : Parent(graph) {}
  1445 	explicit UEdgeMap(const MappableUGraphComponent& graph) 
       
  1446           : Parent(graph) {}
  1444 
  1447 
  1445 	/// \brief Construct a new map with default value.
  1448 	/// \brief Construct a new map with default value.
  1446 	///
  1449 	///
  1447 	/// Construct a new map for the graph and initalise the values.
  1450 	/// Construct a new map for the graph and initalise the values.
  1448 	UEdgeMap(const Graph& graph, const Value& value)
  1451 	UEdgeMap(const MappableUGraphComponent& graph, const _Value& value)
  1449           : Parent(graph, value) {}
  1452           : Parent(graph, value) {}
  1450 
  1453 
  1451 	/// \brief Copy constructor.
  1454 	/// \brief Copy constructor.
  1452 	///
  1455 	///
  1453 	/// Copy Constructor.
  1456 	/// Copy Constructor.
  1456 	/// \brief Assign operator.
  1459 	/// \brief Assign operator.
  1457 	///
  1460 	///
  1458 	/// Assign operator.
  1461 	/// Assign operator.
  1459         template <typename CMap>
  1462         template <typename CMap>
  1460         UEdgeMap& operator=(const CMap&) { 
  1463         UEdgeMap& operator=(const CMap&) { 
  1461           checkConcept<ReadMap<UEdge, Value>, CMap>();
  1464           checkConcept<ReadMap<UEdge, _Value>, CMap>();
  1462           return *this;
  1465           return *this;
  1463         }
  1466         }
  1464 
  1467 
  1465       };
  1468       };
  1466 
  1469