PGROUTING  3.2
Pgr_dag< G >::dijkstra_many_goal_visitor Class Reference

class for stopping when all targets are found More...

Inheritance diagram for Pgr_dag< G >::dijkstra_many_goal_visitor:
Collaboration diagram for Pgr_dag< G >::dijkstra_many_goal_visitor:

Public Member Functions

 dijkstra_many_goal_visitor (const std::vector< V > &goals, size_t n_goals)
 
template<class B_G >
void examine_vertex (V u, B_G &)
 

Private Attributes

std::set< Vm_goals
 
size_t m_n_goals
 

Detailed Description

template<class G>
class Pgr_dag< G >::dijkstra_many_goal_visitor

class for stopping when all targets are found

Definition at line 331 of file pgr_dagShortestPath.hpp.

Constructor & Destructor Documentation

◆ dijkstra_many_goal_visitor()

template<class G >
Pgr_dag< G >::dijkstra_many_goal_visitor::dijkstra_many_goal_visitor ( const std::vector< V > &  goals,
size_t  n_goals 
)
inlineexplicit

Definition at line 333 of file pgr_dagShortestPath.hpp.

335  :
336  m_goals(goals.begin(), goals.end()),
337  m_n_goals(n_goals) {}

Member Function Documentation

◆ examine_vertex()

template<class G >
template<class B_G >
void Pgr_dag< G >::dijkstra_many_goal_visitor::examine_vertex ( V  u,
B_G &   
)
inline

Definition at line 339 of file pgr_dagShortestPath.hpp.

339  {
340  auto s_it = m_goals.find(u);
341  if (s_it == m_goals.end()) return;
342 
343  // found one more goal
344  m_goals.erase(s_it);
345 
346  // all goals found
347  if (m_goals.size() == 0) throw found_goals();
348 
349  // number of requested goals found
350  --m_n_goals;
351  if (m_n_goals == 0) throw found_goals();
352  }

References Pgr_dag< G >::dijkstra_many_goal_visitor::m_goals, and Pgr_dag< G >::dijkstra_many_goal_visitor::m_n_goals.

Member Data Documentation

◆ m_goals

template<class G >
std::set< V > Pgr_dag< G >::dijkstra_many_goal_visitor::m_goals
private

◆ m_n_goals

template<class G >
size_t Pgr_dag< G >::dijkstra_many_goal_visitor::m_n_goals
private

The documentation for this class was generated from the following file:
Pgr_dag::dijkstra_many_goal_visitor::m_n_goals
size_t m_n_goals
Definition: pgr_dagShortestPath.hpp:356
Pgr_dag::dijkstra_many_goal_visitor::m_goals
std::set< V > m_goals
Definition: pgr_dagShortestPath.hpp:355