pgRouting

Changeset 143

Show
Ignore:
Timestamp:
03/27/08 17:14:12 (8 months ago)
Author:
anton
Message:

target edge added to found_goal exception

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/shooting_star_boost_wrapper.cpp

    r140 r143  
    5656 
    5757// exception for termination 
    58 struct found_goal  
     58template <class Edge> 
     59class found_goal  
    5960{ 
    6061  public: 
    6162    found_goal() {} 
     63    found_goal(Edge target) : target_edge(target) {} 
    6264    found_goal(const found_goal &fg) {} 
    6365    ~found_goal() {} 
    64 };  
     66    Edge get_target() 
     67    { 
     68      return target_edge; 
     69    } 
     70  private: 
     71    Edge target_edge; 
     72}; 
     73 
    6574 
    6675// visitor that terminates when we find the goal 
     
    7887    if( g[e].id == g[m_goal].id || g[e].id == g[m_goal].id + e_max_id ) 
    7988    { 
    80       throw found_goal(); 
     89      throw found_goal<Edge>(e); 
    8190    } 
    8291  } 
     
    335344 
    336345  }  
    337   catch(found_goal &fg)  
     346  catch(found_goal<edge_descriptor> &fg)  
    338347  { 
    339348   
    340349    vector<edge_descriptor> path_vect; 
    341350    int max = MAX_NODES; 
     351     
     352    target_edge = fg.get_target(); 
    342353 
    343354    path_vect.push_back(target_edge);