MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / Iterator

Class Iterator

pyvrp/cpp/Route.h:39–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 * Forward iterator through the clients visited by this route.
38 */
39 class Iterator
40 {
41 Route const *route_ = nullptr;
42 size_t trip_ = 0;
43 size_t idx_ = 0;
44
45 public:
46 using iterator_category = std::forward_iterator_tag;
47 using difference_type = std::ptrdiff_t;
48 using value_type = Client;
49
50 Iterator(Route const &route, size_t idx);
51
52 Iterator() = default;
53 Iterator(Iterator const &other) = default;
54 Iterator(Iterator &&other) = default;
55
56 Iterator &operator=(Iterator const &other) = default;
57 Iterator &operator=(Iterator &&other) = default;
58
59 bool operator==(Iterator const &other) const;
60
61 Client operator*() const;
62
63 Iterator operator++(int);
64 Iterator &operator++();
65 };
66
67 /**
68 * Simple object that stores some data about a client or depot visit.

Callers 2

beginMethod · 0.70
endMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected