441 /// and it use the given reader as the default skipper. |
441 /// and it use the given reader as the default skipper. |
442 UGraphReader(std::istream& _is, Graph& _graph, |
442 UGraphReader(std::istream& _is, Graph& _graph, |
443 const DefaultSkipper& _skipper = DefaultSkipper()) |
443 const DefaultSkipper& _skipper = DefaultSkipper()) |
444 : reader(new LemonReader(_is)), own_reader(true), skipper(_skipper), |
444 : reader(new LemonReader(_is)), own_reader(true), skipper(_skipper), |
445 nodeset_reader(*reader, _graph, std::string(), skipper), |
445 nodeset_reader(*reader, _graph, std::string(), skipper), |
446 u_edgeset_reader(*reader, _graph, nodeset_reader, |
446 uedgeset_reader(*reader, _graph, nodeset_reader, |
447 std::string(), skipper), |
447 std::string(), skipper), |
448 node_reader(*reader, nodeset_reader, std::string()), |
448 node_reader(*reader, nodeset_reader, std::string()), |
449 u_edge_reader(*reader, u_edgeset_reader, std::string()), |
449 uedge_reader(*reader, uedgeset_reader, std::string()), |
450 attribute_reader(*reader, std::string()) {} |
450 attribute_reader(*reader, std::string()) {} |
451 |
451 |
452 /// \brief Construct a new UGraphReader. |
452 /// \brief Construct a new UGraphReader. |
453 /// |
453 /// |
454 /// Construct a new UGraphReader. It reads into the given graph |
454 /// Construct a new UGraphReader. It reads into the given graph |
456 UGraphReader(const std::string& _filename, Graph& _graph, |
456 UGraphReader(const std::string& _filename, Graph& _graph, |
457 const DefaultSkipper& _skipper = DefaultSkipper()) |
457 const DefaultSkipper& _skipper = DefaultSkipper()) |
458 : reader(new LemonReader(_filename)), own_reader(true), |
458 : reader(new LemonReader(_filename)), own_reader(true), |
459 skipper(_skipper), |
459 skipper(_skipper), |
460 nodeset_reader(*reader, _graph, std::string(), skipper), |
460 nodeset_reader(*reader, _graph, std::string(), skipper), |
461 u_edgeset_reader(*reader, _graph, nodeset_reader, |
461 uedgeset_reader(*reader, _graph, nodeset_reader, |
462 std::string(), skipper), |
462 std::string(), skipper), |
463 node_reader(*reader, nodeset_reader, std::string()), |
463 node_reader(*reader, nodeset_reader, std::string()), |
464 u_edge_reader(*reader, u_edgeset_reader, std::string()), |
464 uedge_reader(*reader, uedgeset_reader, std::string()), |
465 attribute_reader(*reader, std::string()) {} |
465 attribute_reader(*reader, std::string()) {} |
466 |
466 |
467 /// \brief Construct a new UGraphReader. |
467 /// \brief Construct a new UGraphReader. |
468 /// |
468 /// |
469 /// Construct a new UGraphReader. It reads into the given graph |
469 /// Construct a new UGraphReader. It reads into the given graph |
470 /// and it use the given reader as the default skipper. |
470 /// and it use the given reader as the default skipper. |
471 UGraphReader(LemonReader& _reader, Graph& _graph, |
471 UGraphReader(LemonReader& _reader, Graph& _graph, |
472 const DefaultSkipper& _skipper = DefaultSkipper()) |
472 const DefaultSkipper& _skipper = DefaultSkipper()) |
473 : reader(_reader), own_reader(false), skipper(_skipper), |
473 : reader(_reader), own_reader(false), skipper(_skipper), |
474 nodeset_reader(*reader, _graph, std::string(), skipper), |
474 nodeset_reader(*reader, _graph, std::string(), skipper), |
475 u_edgeset_reader(*reader, _graph, nodeset_reader, |
475 uedgeset_reader(*reader, _graph, nodeset_reader, |
476 std::string(), skipper), |
476 std::string(), skipper), |
477 node_reader(*reader, nodeset_reader, std::string()), |
477 node_reader(*reader, nodeset_reader, std::string()), |
478 u_edge_reader(*reader, u_edgeset_reader, std::string()), |
478 uedge_reader(*reader, uedgeset_reader, std::string()), |
479 attribute_reader(*reader, std::string()) {} |
479 attribute_reader(*reader, std::string()) {} |
480 |
480 |
481 /// \brief Destruct the graph reader. |
481 /// \brief Destruct the graph reader. |
482 /// |
482 /// |
483 /// Destruct the graph reader. |
483 /// Destruct the graph reader. |
531 /// \brief Give a new undirected edge map reading command to the reader. |
531 /// \brief Give a new undirected edge map reading command to the reader. |
532 /// |
532 /// |
533 /// Give a new undirected edge map reading command to the reader. |
533 /// Give a new undirected edge map reading command to the reader. |
534 template <typename Map> |
534 template <typename Map> |
535 UGraphReader& readUEdgeMap(std::string name, Map& map) { |
535 UGraphReader& readUEdgeMap(std::string name, Map& map) { |
536 u_edgeset_reader.readUEdgeMap(name, map); |
536 uedgeset_reader.readUEdgeMap(name, map); |
537 return *this; |
537 return *this; |
538 } |
538 } |
539 |
539 |
540 template <typename Map> |
540 template <typename Map> |
541 UGraphReader& readUEdgeMap(std::string name, const Map& map) { |
541 UGraphReader& readUEdgeMap(std::string name, const Map& map) { |
542 u_edgeset_reader.readUEdgeMap(name, map); |
542 uedgeset_reader.readUEdgeMap(name, map); |
543 return *this; |
543 return *this; |
544 } |
544 } |
545 |
545 |
546 |
546 |
547 /// \brief Give a new undirected edge map reading command to the reader. |
547 /// \brief Give a new undirected edge map reading command to the reader. |
548 /// |
548 /// |
549 /// Give a new undirected edge map reading command to the reader. |
549 /// Give a new undirected edge map reading command to the reader. |
550 template <typename ItemReader, typename Map> |
550 template <typename ItemReader, typename Map> |
551 UGraphReader& readUEdgeMap(std::string name, Map& map, |
551 UGraphReader& readUEdgeMap(std::string name, Map& map, |
552 const ItemReader& ir = ItemReader()) { |
552 const ItemReader& ir = ItemReader()) { |
553 u_edgeset_reader.readUEdgeMap(name, map, ir); |
553 uedgeset_reader.readUEdgeMap(name, map, ir); |
554 return *this; |
554 return *this; |
555 } |
555 } |
556 |
556 |
557 template <typename ItemReader, typename Map> |
557 template <typename ItemReader, typename Map> |
558 UGraphReader& readUEdgeMap(std::string name, const Map& map, |
558 UGraphReader& readUEdgeMap(std::string name, const Map& map, |
559 const ItemReader& ir = ItemReader()) { |
559 const ItemReader& ir = ItemReader()) { |
560 u_edgeset_reader.readUEdgeMap(name, map, ir); |
560 uedgeset_reader.readUEdgeMap(name, map, ir); |
561 return *this; |
561 return *this; |
562 } |
562 } |
563 |
563 |
564 /// \brief Give a new undirected edge map skipping command to the reader. |
564 /// \brief Give a new undirected edge map skipping command to the reader. |
565 /// |
565 /// |
566 /// Give a new undirected edge map skipping command to the reader. |
566 /// Give a new undirected edge map skipping command to the reader. |
567 template <typename ItemReader> |
567 template <typename ItemReader> |
568 UGraphReader& skipUEdgeMap(std::string name, |
568 UGraphReader& skipUEdgeMap(std::string name, |
569 const ItemReader& ir = ItemReader()) { |
569 const ItemReader& ir = ItemReader()) { |
570 u_edgeset_reader.skipUMap(name, ir); |
570 uedgeset_reader.skipUMap(name, ir); |
571 return *this; |
571 return *this; |
572 } |
572 } |
573 |
573 |
574 |
574 |
575 /// \brief Give a new edge map reading command to the reader. |
575 /// \brief Give a new edge map reading command to the reader. |
576 /// |
576 /// |
577 /// Give a new edge map reading command to the reader. |
577 /// Give a new edge map reading command to the reader. |
578 template <typename Map> |
578 template <typename Map> |
579 UGraphReader& readEdgeMap(std::string name, Map& map) { |
579 UGraphReader& readEdgeMap(std::string name, Map& map) { |
580 u_edgeset_reader.readEdgeMap(name, map); |
580 uedgeset_reader.readEdgeMap(name, map); |
581 return *this; |
581 return *this; |
582 } |
582 } |
583 |
583 |
584 template <typename Map> |
584 template <typename Map> |
585 UGraphReader& readEdgeMap(std::string name, const Map& map) { |
585 UGraphReader& readEdgeMap(std::string name, const Map& map) { |
586 u_edgeset_reader.readEdgeMap(name, map); |
586 uedgeset_reader.readEdgeMap(name, map); |
587 return *this; |
587 return *this; |
588 } |
588 } |
589 |
589 |
590 |
590 |
591 /// \brief Give a new edge map reading command to the reader. |
591 /// \brief Give a new edge map reading command to the reader. |
592 /// |
592 /// |
593 /// Give a new edge map reading command to the reader. |
593 /// Give a new edge map reading command to the reader. |
594 template <typename ItemReader, typename Map> |
594 template <typename ItemReader, typename Map> |
595 UGraphReader& readEdgeMap(std::string name, Map& map, |
595 UGraphReader& readEdgeMap(std::string name, Map& map, |
596 const ItemReader& ir = ItemReader()) { |
596 const ItemReader& ir = ItemReader()) { |
597 u_edgeset_reader.readEdgeMap(name, map, ir); |
597 uedgeset_reader.readEdgeMap(name, map, ir); |
598 return *this; |
598 return *this; |
599 } |
599 } |
600 |
600 |
601 template <typename ItemReader, typename Map> |
601 template <typename ItemReader, typename Map> |
602 UGraphReader& readEdgeMap(std::string name, const Map& map, |
602 UGraphReader& readEdgeMap(std::string name, const Map& map, |
603 const ItemReader& ir = ItemReader()) { |
603 const ItemReader& ir = ItemReader()) { |
604 u_edgeset_reader.readEdgeMap(name, map, ir); |
604 uedgeset_reader.readEdgeMap(name, map, ir); |
605 return *this; |
605 return *this; |
606 } |
606 } |
607 |
607 |
608 /// \brief Give a new edge map skipping command to the reader. |
608 /// \brief Give a new edge map skipping command to the reader. |
609 /// |
609 /// |
610 /// Give a new edge map skipping command to the reader. |
610 /// Give a new edge map skipping command to the reader. |
611 template <typename ItemReader> |
611 template <typename ItemReader> |
612 UGraphReader& skipEdgeMap(std::string name, |
612 UGraphReader& skipEdgeMap(std::string name, |
613 const ItemReader& ir = ItemReader()) { |
613 const ItemReader& ir = ItemReader()) { |
614 u_edgeset_reader.skipEdgeMap(name, ir); |
614 uedgeset_reader.skipEdgeMap(name, ir); |
615 return *this; |
615 return *this; |
616 } |
616 } |
617 |
617 |
618 /// \brief Give a new labeled node reading command to the reader. |
618 /// \brief Give a new labeled node reading command to the reader. |
619 /// |
619 /// |