PGROUTING  3.2
edges_order_bfs_visitor.hpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File:.edges_order_bfs_visitor.hpp
3 
4 Copyright (c) 2015 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_EDGES_ORDER_BFS_VISITOR_HPP_
30 #define INCLUDE_VISITORS_EDGES_ORDER_BFS_VISITOR_HPP_
31 #pragma once
32 
33 #include <boost/graph/breadth_first_search.hpp>
34 #include <vector>
35 
36 
37 namespace pgrouting {
38 namespace visitors {
39 
40 template <class E>
41 class Edges_order_bfs_visitor : public boost::default_bfs_visitor {
42  public:
44  std::vector<E> &data) :
45  m_data(data) {}
46  template <class B_G>
47  void tree_edge(E e, const B_G&) {
48  m_data.push_back(e);
49  }
50  private:
51  std::vector<E> &m_data;
52 };
53 
54 
55 } // namespace visitors
56 } // namespace pgrouting
57 
58 #endif // INCLUDE_VISITORS_EDGES_ORDER_BFS_VISITOR_HPP_
pgrouting::visitors::Edges_order_bfs_visitor::Edges_order_bfs_visitor
Edges_order_bfs_visitor(std::vector< E > &data)
Definition: edges_order_bfs_visitor.hpp:43
pgrouting::alphashape::E
boost::graph_traits< BG >::edge_descriptor E
Definition: pgr_alphaShape.h:57
pgrouting::visitors::Edges_order_bfs_visitor::m_data
std::vector< E > & m_data
Definition: edges_order_bfs_visitor.hpp:51
pgrouting::visitors::Edges_order_bfs_visitor
Definition: edges_order_bfs_visitor.hpp:41
pgrouting::visitors::Edges_order_bfs_visitor::tree_edge
void tree_edge(E e, const B_G &)
Definition: edges_order_bfs_visitor.hpp:47
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56