PGROUTING  3.2
prim_dijkstra_visitor.hpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: prim_dijkstra_visitor.hpp
3 
4 Copyright (c) 2018 pgRouting developers
6 
7 Copyright (c) 2018 Aditya Pratap Singh
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*/
29 #ifndef INCLUDE_VISITORS_PRIM_DIJKSTRA_VISITOR_HPP_
30 #define INCLUDE_VISITORS_PRIM_DIJKSTRA_VISITOR_HPP_
31 #pragma once
32 
33 #include <boost/graph/dijkstra_shortest_paths.hpp>
34 #include <vector>
35 
36 
37 namespace pgrouting {
38 namespace visitors {
39 
40 /* Prim */
41 template <class V>
42 class Prim_dijkstra_visitor : public boost::default_dijkstra_visitor {
43  public:
45  std::vector<V> &data) :
46  m_data(data) {}
47  template <class B_G>
48  void finish_vertex(V v, B_G&) {
49  m_data.push_back(v);
50  }
51  private:
52  std::vector<V> &m_data;
53 };
54 
55 } // namespace visitors
56 } // namespace pgrouting
57 
58 #endif // INCLUDE_VISITORS_PRIM_DIJKSTRA_VISITOR_HPP_
pgrouting::visitors::Prim_dijkstra_visitor::Prim_dijkstra_visitor
Prim_dijkstra_visitor(std::vector< V > &data)
Definition: prim_dijkstra_visitor.hpp:44
pgrouting::visitors::Prim_dijkstra_visitor::m_data
std::vector< V > & m_data
Definition: prim_dijkstra_visitor.hpp:52
pgrouting::visitors::Prim_dijkstra_visitor
Definition: prim_dijkstra_visitor.hpp:42
pgrouting::alphashape::V
boost::graph_traits< BG >::vertex_descriptor V
Definition: pgr_alphaShape.h:58
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56
pgrouting::visitors::Prim_dijkstra_visitor::finish_vertex
void finish_vertex(V v, B_G &)
Definition: prim_dijkstra_visitor.hpp:48