PGROUTING  3.2
pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor Class Reference

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

Inheritance diagram for pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor:
Collaboration diagram for pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor:

Public Member Functions

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

Private Attributes

std::set< V > & m_found_goals
 
std::set< Vm_goals
 
size_t m_n_goals
 

Detailed Description

template<class G>
class pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor

class for stopping when all targets are found

Definition at line 750 of file pgr_dijkstra.hpp.

Constructor & Destructor Documentation

◆ dijkstra_many_goal_visitor()

template<class G >
pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::dijkstra_many_goal_visitor ( const std::set< V > &  goals,
size_t  n_goals,
std::set< V > &  f_goals 
)
inline

Definition at line 752 of file pgr_dijkstra.hpp.

755  :
756  m_goals(goals),
757  m_n_goals(n_goals),
758  m_found_goals(f_goals) {
759  }

Member Function Documentation

◆ examine_vertex()

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

Definition at line 761 of file pgr_dijkstra.hpp.

761  {
762  auto s_it = m_goals.find(u);
763 
764  /* examined vertex is not a goal */
765  if (s_it == m_goals.end()) return;
766 
767  // found one more goal
768  m_found_goals.insert(*s_it);
769  m_goals.erase(s_it);
770 
771  // all goals found
772  if (m_goals.size() == 0) throw found_goals();
773 
774  // number of requested goals found
775  --m_n_goals;
776  if (m_n_goals == 0) throw found_goals();
777  }

References pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::m_found_goals, pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::m_goals, and pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::m_n_goals.

Member Data Documentation

◆ m_found_goals

template<class G >
std::set< V >& pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::m_found_goals
private

◆ m_goals

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

◆ m_n_goals

template<class G >
size_t pgrouting::Pgr_dijkstra< G >::dijkstra_many_goal_visitor::m_n_goals
private

The documentation for this class was generated from the following file:
pgrouting::Pgr_dijkstra::dijkstra_many_goal_visitor::m_n_goals
size_t m_n_goals
Definition: pgr_dijkstra.hpp:781
pgrouting::Pgr_dijkstra::dijkstra_many_goal_visitor::m_found_goals
std::set< V > & m_found_goals
Definition: pgr_dijkstra.hpp:782
pgrouting::Pgr_dijkstra::dijkstra_many_goal_visitor::m_goals
std::set< V > m_goals
Definition: pgr_dijkstra.hpp:780