PGROUTING  3.2
dijkstra_one_goal_visitor.hpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 file: dijkstra_one_goal_visitor.hpp
3 
4 Copyright (c) 2018 pgRouting developers
6 
7 Copyright (c) 2018 Celia Virginia Vergara Castillo
9 
10 ------
11 
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16 
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21 
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 
26  ********************************************************************PGR-GNU*/
27 
28 #ifndef INCLUDE_VISITORS_DIJKSTRA_ONE_GOAL_VISITOR_HPP_
29 #define INCLUDE_VISITORS_DIJKSTRA_ONE_GOAL_VISITOR_HPP_
30 
31 #include <boost/graph/dijkstra_shortest_paths.hpp>
32 
33 #include "visitors/found_goals.hpp"
34 
35 namespace pgrouting {
36 namespace visitors {
37 
38 template <typename V>
39 class dijkstra_one_goal_visitor : public boost::default_dijkstra_visitor {
40  public:
41  explicit dijkstra_one_goal_visitor(V goal) : m_goal(goal) {}
42  template <class B_G>
43  void examine_vertex(V &u, B_G &) {
44  if (u == m_goal) throw found_goals();
45  }
46  private:
48 };
49 
50 } // namespace visitors
51 } // namespace pgrouting
52 
53 #endif // INCLUDE_VISITORS_DIJKSTRA_ONE_GOAL_VISITOR_HPP_
pgrouting::visitors::dijkstra_one_goal_visitor::m_goal
V m_goal
Definition: dijkstra_one_goal_visitor.hpp:47
pgrouting::visitors::dijkstra_one_goal_visitor
Definition: dijkstra_one_goal_visitor.hpp:39
found_goals.hpp
pgrouting::found_goals
exception for visitor termination
Definition: found_goals.hpp:33
pgrouting::visitors::dijkstra_one_goal_visitor::examine_vertex
void examine_vertex(V &u, B_G &)
Definition: dijkstra_one_goal_visitor.hpp:43
pgrouting::alphashape::V
boost::graph_traits< BG >::vertex_descriptor V
Definition: pgr_alphaShape.h:58
pgrouting::visitors::dijkstra_one_goal_visitor::dijkstra_one_goal_visitor
dijkstra_one_goal_visitor(V goal)
Definition: dijkstra_one_goal_visitor.hpp:41
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56