Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. void Simulator:: iniToJunctionMap(){
  2.  
  3. boost::property_tree::ptree pt;
  4. boost::property_tree::ini_parser::read_ini("RoadMap.ini", pt);
  5.  
  6. for (boost::property_tree::ptree::const_iterator sectionIter = pt.begin();sectionIter != pt.end(); sectionIter++) {
  7. string end=sectionIter->first;
  8. Junction* newJunction = new Junction (end,*this);
  9. for (boost::property_tree::ptree::const_iterator propertyIter = sectionIter->second.begin(); propertyIter != sectionIter->second.end(); propertyIter++){
  10. string start=propertyIter->first;
  11. string roadId=start+end;
  12. Road* incomingRoad = (RoadMap[roadId]);
  13. newJunction->incomingRoads.push_back(incomingRoad);
  14. }
  15.  
  16. JunctionMap.insert(pair<string,Junction*>(end,newJunction));
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement