diff --git a/src/connection/closeRoadConnection.h b/src/connection/closeRoadConnection.h index e37f338..8d30b4b 100644 --- a/src/connection/closeRoadConnection.h +++ b/src/connection/closeRoadConnection.h @@ -34,7 +34,7 @@ * @param phi2 angle of end point * @return int error code */ -int closeRoadConnection(vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) +int closeRoadConnection(std::vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) { // goal: compute new road from point 1 to point 2, preserving angles @@ -85,12 +85,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + M_PI / 2; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -111,12 +111,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + M_PI / 2; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << std::endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -152,12 +152,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + M_PI / 2; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -169,7 +169,7 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 addLine(geo, x1, y1, phi1, iPx, iPy, phi1); if (closeRoadConnection(geo, iPx, iPy, phi1, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -190,12 +190,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + M_PI / 2; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -207,12 +207,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 - M_PI / 2; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -229,7 +229,7 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 addLine(geo, x1, y1, phi1, xTmp, yTmp, phi1); if (addArc(geo, xTmp, yTmp, phi1, x2, y2, phi2)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } } @@ -240,12 +240,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double yTmp = y2 - sin(phi2) * (d2 - d1); if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phi2)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (addLine(geo, xTmp, yTmp, phi2, x2, y2, phi2)) { - cerr << "ERR: error in addLine function." << endl; + std::cerr << "ERR: error in addLine function." << std::endl; return 1; } } @@ -254,7 +254,7 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 { if (addArc(geo, x1, y1, phi1, x2, y2, phi2)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } } @@ -265,7 +265,7 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 // almost nothing to be done if (addLine(geo, x1, y1, phi1, x2, y2, phi2)) { - cerr << "ERR: error in addLine function." << endl; + std::cerr << "ERR: error in addLine function." << std::endl; return 1; } } @@ -290,12 +290,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + 2 * alpha; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } @@ -317,12 +317,12 @@ int closeRoadConnection(vector &geo, double x1, double y1, double phi1 double phiTmp = phi1 + 2 * beta; if (addArc(geo, x1, y1, phi1, xTmp, yTmp, phiTmp)) { - cerr << "ERR: error in addArc function." << endl; + std::cerr << "ERR: error in addArc function." << std::endl; return 1; } if (closeRoadConnection(geo, xTmp, yTmp, phiTmp, x2, y2, phi2)) { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } } diff --git a/src/connection/closeRoadNetwork.h b/src/connection/closeRoadNetwork.h index a8fe101..1c10ea5 100644 --- a/src/connection/closeRoadNetwork.h +++ b/src/connection/closeRoadNetwork.h @@ -29,7 +29,7 @@ extern settings setting; int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) { if(!setting.silentMode) - cout << "Processing closeRoadNetwork" << endl; + std::cout << "Processing closeRoadNetwork" << std::endl; DOMElement* closeRoad = getChildWithName(rootNode, "closeRoads"); @@ -55,8 +55,8 @@ int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) int toSegment = readIntAttrFromNode(segmentLink, "toSegment"); int fromRoadId = readIntAttrFromNode(segmentLink, "fromRoad"); int toRoadId = readIntAttrFromNode(segmentLink, "toRoad"); - string fromPos = readStrAttrFromNode(segmentLink, "fromPos"); - string toPos = readStrAttrFromNode(segmentLink, "toPos"); + std::string fromPos = readStrAttrFromNode(segmentLink, "fromPos"); + std::string toPos = readStrAttrFromNode(segmentLink, "toPos"); road fromRoad; road toRoad; @@ -122,14 +122,14 @@ int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) } else { - cerr << "ERR: wrong position for fromPos is specified." << endl; - cerr << "\t -> use 'start' or 'end'" << endl; + std::cerr << "ERR: wrong position for fromPos is specified." << std::endl; + std::cerr << "\t -> use 'start' or 'end'" << std::endl; return 1; } } if (!found) { - cerr << "ERR: from road not found." << endl; + std::cerr << "ERR: from road not found." << std::endl; return 1; } @@ -176,14 +176,14 @@ int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) } else { - cerr << "ERR: wrong position for toPos is specified." << endl; - cerr << "\t -> use 'start' or 'end'" << endl; + std::cerr << "ERR: wrong position for toPos is specified." << std::endl; + std::cerr << "\t -> use 'start' or 'end'" << std::endl; return 1; } } if (!found) { - cerr << "ERR: to road not found." << endl; + std::cerr << "ERR: to road not found." << std::endl; return 1; } @@ -195,7 +195,7 @@ int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) // --- build new geometry ---------------------------------------------- if (closeRoadConnection(rConnection.geometries, fromX, fromY, fromHdg, toX, toY, toHdg)) //the tohdg angle is wrong some of the time { - cerr << "ERR: error in closeRoadConnection function." << endl; + std::cerr << "ERR: error in closeRoadConnection function." << std::endl; return 1; } @@ -208,7 +208,7 @@ int closeRoadNetwork(const DOMElement* rootNode, roadNetwork &data) } // --- add lanes ------------------------------------------------------- - vector secs; + std::vector secs; // flip lanes if in false direction if (fromPos == "start") diff --git a/src/connection/linkSegments.h b/src/connection/linkSegments.h index 01594fe..8215a97 100644 --- a/src/connection/linkSegments.h +++ b/src/connection/linkSegments.h @@ -54,7 +54,7 @@ int resolveAlignmentConflicts(roadNetwork &data) int borderingLaneSection = 0; if(r.successor.contactPoint == endType) borderingLaneSection = r.laneSections.size() - 1; - vector laneIds; + std::vector laneIds; for(lane &l: r.laneSections.at(borderingLaneSection).lanes) { laneIds.insert(laneIds.begin(), l.id); @@ -66,7 +66,7 @@ int resolveAlignmentConflicts(roadNetwork &data) r.laneSections.at(borderingLaneSection).lanes[i].sucId = laneIds[i]; } - cerr << "switched road " << r.id << " and succ " <id << endl; + std::cerr << "switched road " << r.id << " and succ " <id << std::endl; } } @@ -94,7 +94,7 @@ int resolveAlignmentConflicts(roadNetwork &data) int borderingLaneSection = 0; if(r.predecessor.contactPoint == endType) borderingLaneSection = r.laneSections.size() - 1; - vector laneIds; + std::vector laneIds; for(lane &l: r.laneSections.at(borderingLaneSection).lanes) { laneIds.insert(laneIds.begin(), l.id); @@ -106,7 +106,7 @@ int resolveAlignmentConflicts(roadNetwork &data) r.laneSections.at(borderingLaneSection).lanes[i].preId = laneIds[i]; } - cerr << "switched road " << r.id << " and pre " <id << endl; + std::cerr << "switched road " << r.id << " and pre " <id << std::endl; } } @@ -192,8 +192,8 @@ int transformRoad(DOMElement *segmentLink, roadNetwork &data, bool swap = false) int toSegment = readIntAttrFromNode(segmentLink, "toSegment"); int fromRoadId = readIntAttrFromNode(segmentLink, "fromRoad"); int toRoadId = readIntAttrFromNode(segmentLink, "toRoad"); - string fromPos = readStrAttrFromNode(segmentLink, "fromPos"); - string toPos = readStrAttrFromNode(segmentLink, "toPos"); + std::string fromPos = readStrAttrFromNode(segmentLink, "fromPos"); + std::string toPos = readStrAttrFromNode(segmentLink, "toPos"); if(swap) { fromSegment = readIntAttrFromNode(segmentLink, "toSegment"); @@ -450,7 +450,7 @@ extern settings setting; int linkSegments(const DOMElement* rootNode, roadNetwork &data) { if(!setting.silentMode) - cout << "Processing linkSegments" << endl; + std::cout << "Processing linkSegments" << std::endl; DOMElement *links = getChildWithName(rootNode, "links"); @@ -458,7 +458,7 @@ int linkSegments(const DOMElement* rootNode, roadNetwork &data) { if(!setting.silentMode) { - cout << "\tLinks are not specified -> skip segment linking" << endl; + std::cout << "\tLinks are not specified -> skip segment linking" << std::endl; } throwWarning("'links' are not specified in input file.\n\t -> skip segment linking", true); @@ -492,20 +492,20 @@ int linkSegments(const DOMElement* rootNode, roadNetwork &data) } //generate a map to store all outgoing links of each segment - std::map> outgoing_connections; - std::map> incoming_connections; + std::map> outgoing_connections; + std::map> incoming_connections; int linkcount = links->getChildElementCount(); if(linkcount <= 0 && !setting.silentMode) { - cout << "\tNo links are defined" << endl; + std::cout << "\tNo links are defined" << std::endl; return 0; } else if(!setting.silentMode) { - cout << "\t"<< linkcount << " links are defined" << endl; + std::cout << "\t"<< linkcount << " links are defined" << std::endl; } for (DOMElement *segmentLink = links->getFirstElementChild();segmentLink != NULL; segmentLink = segmentLink->getNextElementSibling()) @@ -520,8 +520,8 @@ int linkSegments(const DOMElement* rootNode, roadNetwork &data) } - queue toDo = queue(); //remaining segments - vector transformedIds; + std::queue toDo = std::queue(); //remaining segments + std::vector transformedIds; toDo.push(refId); while(!toDo.empty()) @@ -570,7 +570,7 @@ int linkSegments(const DOMElement* rootNode, roadNetwork &data) } //check if all roads are connected to the network - vector v; + std::vector v; for(road &r: data.roads) { if(!r.isLinkedToNetwork) @@ -584,8 +584,8 @@ int linkSegments(const DOMElement* rootNode, roadNetwork &data) for(road* p: v) { if(!setting.silentMode) - cout << "\tRoad " << p->inputId << " in segment " << p->inputSegmentId << " is not linked"<< endl; - std::cerr << "\tRoad " << p->inputSegmentId << " is not linked"<< endl; + std::cout << "\tRoad " << p->inputId << " in segment " << p->inputSegmentId << " is not linked"<< std::endl; + std::cerr << "\tRoad " << p->inputSegmentId << " is not linked"<< std::endl; } diff --git a/src/generation/addLaneSections.h b/src/generation/addLaneSections.h index 02258fc..f6dbb03 100644 --- a/src/generation/addLaneSections.h +++ b/src/generation/addLaneSections.h @@ -25,7 +25,7 @@ * @param addouterLane specifies if additional lane is on the outer side or not * @return int error code */ -int addLaneWidening(vector &secs, int addLaneId, double s, double ds, bool addOuterLane) +int addLaneWidening(std::vector &secs, int addLaneId, double s, double ds, bool addOuterLane) { std::vector::iterator it; int i = 0; @@ -65,7 +65,7 @@ int addLaneWidening(vector &secs, int addLaneId, double s, double d if (laneId == 0 || abs(laneId) >= 100) { - cerr << "ERR: lane widening can not be performed" << endl; + std::cerr << "ERR: lane widening can not be performed" << std::endl; return 1; } @@ -161,7 +161,7 @@ int addLaneWidening(vector &secs, int addLaneId, double s, double d * @param ds length of laneDrop * @return int error code */ -int addLaneDrop(vector &secs, int dropLaneID, double s, double ds) +int addLaneDrop(std::vector &secs, int dropLaneID, double s, double ds) { std::vector::iterator it; std::vector::iterator itt; @@ -192,7 +192,7 @@ int addLaneDrop(vector &secs, int dropLaneID, double s, double ds) if (dropLaneID == 0 || abs(laneId) >= 100) { - cerr << "ERR: lane drop can not be performed" << endl; + std::cerr << "ERR: lane drop can not be performed" << std::endl; } adLaneSec.id = it->id + 1; @@ -302,14 +302,14 @@ int addLaneDrop(vector &secs, int dropLaneID, double s, double ds) * @param ds2 length of restricted areay (always lager than ds1) * @return int error code */ -int addRestrictedAreaWidening(vector &secs, int side, double s, double ds1, double ds2) +int addRestrictedAreaWidening(std::vector &secs, int side, double s, double ds1, double ds2) { std::vector::iterator it; std::vector::iterator itt; if (ds1 >= ds2) { - cerr << "ERR: length in restricted area is to short." << endl; + std::cerr << "ERR: length in restricted area is to short." << std::endl; return 1; } @@ -341,7 +341,7 @@ int addRestrictedAreaWidening(vector &secs, int side, double s, dou if (laneId == 0 || abs(laneId) >= 100) { - cerr << "ERR: restricted area widening can not be performed" << endl; + std::cerr << "ERR: restricted area widening can not be performed" << std::endl; } lane l, lTmp; @@ -418,14 +418,14 @@ int addRestrictedAreaWidening(vector &secs, int side, double s, dou * @param ds2 length of restricted areay (always lager than ds1) * @return int error code */ -int addRestrictedAreaDrop(vector &secs, int side, double s, double ds1, double ds2) +int addRestrictedAreaDrop(std::vector &secs, int side, double s, double ds1, double ds2) { std::vector::iterator it; std::vector::iterator itt; if (ds1 >= ds2) { - cerr << "ERR: length in restricted area is to short." << endl; + std::cerr << "ERR: length in restricted area is to short." << std::endl; return 1; } @@ -457,7 +457,7 @@ int addRestrictedAreaDrop(vector &secs, int side, double s, double if (laneId == 0 || abs(laneId) >= 100) { - cerr << "ERR: restriced area drop can not be performed" << endl; + std::cerr << "ERR: restriced area drop can not be performed" << std::endl; } lane l, lTmp; @@ -581,7 +581,7 @@ int laneWideningJunction(road &r, double s, double ds, int turn, bool verschwenk if (restricted) turn = 1; - vector::iterator it = r.laneSections.begin(); + std::vector::iterator it = r.laneSections.begin(); laneSection adLaneSec = *it; adLaneSec.s = 0; diff --git a/src/generation/addObjects.h b/src/generation/addObjects.h index 98b5c63..040db5a 100644 --- a/src/generation/addObjects.h +++ b/src/generation/addObjects.h @@ -178,7 +178,7 @@ int addRoadWork(object o, road &r, int laneId) } else { - cerr << "ERR: Length of roadwork is longer than laneSection." << endl; + std::cerr << "ERR: Length of roadwork is longer than laneSection." << std::endl; return 1; } @@ -258,12 +258,12 @@ int addBusStop(object o, road &r) if (addLaneWidening(r.laneSections, side, o.s - length / 2 - widening, widening, true)) { - cerr << "ERR: error in addLaneWidening" << endl; + std::cerr << "ERR: error in addLaneWidening" << std::endl; return 1; } if (addLaneDrop(r.laneSections, side, o.s + length / 2, widening)) { - cerr << "ERR: error in addLaneDrop" << endl; + std::cerr << "ERR: error in addLaneDrop" << std::endl; return 1; } @@ -411,7 +411,7 @@ int addObjects(DOMElement* inRoad, road &r, roadNetwork &data) * @param controller controllerof signal * @return int error code */ -int addSignal(road &r, roadNetwork &data, double s, double t, string type, string subtype, int controller) +int addSignal(road &r, roadNetwork &data, double s, double t, std::string type, std::string subtype, int controller) { if (controller == -1) controller = 1000 + r.junction * 100; diff --git a/src/generation/buildRoad.h b/src/generation/buildRoad.h index 6bd9e95..73542e1 100644 --- a/src/generation/buildRoad.h +++ b/src/generation/buildRoad.h @@ -540,7 +540,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (side == 0) { - cerr << "ERR: laneWidening with side = 0" << endl; + std::cerr << "ERR: laneWidening with side = 0" << std::endl; return 1; } @@ -556,7 +556,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (addLaneWidening(r.laneSections, side, s, ds, false)) { - cerr << "ERR: error in addLaneWidening"; + std::cerr << "ERR: error in addLaneWidening"; return 1; } @@ -569,7 +569,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (addRestrictedAreaWidening(r.laneSections, side, s, ds, ds2)) { - cerr << "ERR: error in addRestrictedAreaWidening" << endl; + std::cerr << "ERR: error in addRestrictedAreaWidening" << std::endl; return 1; } } @@ -580,7 +580,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (side == 0) { - cerr << "ERR: laneWidening with side = 0" << endl; + std::cerr << "ERR: laneWidening with side = 0" << std::endl; return 1; } @@ -596,7 +596,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (addLaneDrop(r.laneSections, side, s, ds)) { - cerr << "ERR: error in addLaneDrop"; + std::cerr << "ERR: error in addLaneDrop"; return 1; } @@ -609,7 +609,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (addRestrictedAreaDrop(r.laneSections, side, s, ds, ds2)) { - cerr << "ERR: error in addRestrictedAreaDrop"; + std::cerr << "ERR: error in addRestrictedAreaDrop"; return 1; } } @@ -621,7 +621,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide double widening_s = setting.laneChange.s; double widening_ds = setting.laneChange.ds; - string active = "main"; + std::string active = "main"; if (automaticWidening != NULL) { @@ -644,7 +644,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide { if (laneWideningJunction(r, widening_s, widening_ds, 1, true, restricted)) { - cerr << "ERR: error in laneWideningJunction"; + std::cerr << "ERR: error in laneWideningJunction\n"; return 1; } } @@ -653,7 +653,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide if (laneWideningJunction(r, widening_s, widening_ds, 1, true, restricted)) { - cerr << "ERR: error in laneWideningJunction"; + std::cerr << "ERR: error in laneWideningJunction\n"; return 1; } } @@ -661,7 +661,7 @@ int addLaneSectionChanges(DOMElement* roadIn, road &r, DOMElement* automaticWide { if (laneWideningJunction(r, widening_s, widening_ds, 1, true, restricted)) { - cerr << "ERR: error in laneWideningJunction"; + std::cerr << "ERR: error in laneWideningJunction\n"; return 1; } } @@ -713,14 +713,14 @@ int buildRoad(DOMElement* roadIn, road &r, double sStart, double sEnd, DOMElemen // generate geometries if (generateGeometries(roadIn, r, sStart, sEnd)) { - cerr << "ERR: error in generateGeometries"; + std::cerr << "ERR: error in generateGeometries"; return 1; } // shift geometries if (shiftGeometries(r, sStart, sEnd, s0, x0, y0, phi0)) { - cerr << "ERR: error in shiftGeometries"; + std::cerr << "ERR: error in shiftGeometries"; return 1; } @@ -729,21 +729,21 @@ int buildRoad(DOMElement* roadIn, road &r, double sStart, double sEnd, DOMElemen { if (flipGeometries(r)) { - cerr << "ERR: error in flipGeometries"; + std::cerr << "ERR: error in flipGeometries"; return 1; } } // add lanes if (addLanes(roadIn, r, mode)) { - cerr << "ERR: error in addLanes"; + std::cerr << "ERR: error in addLanes"; return 1; } // // add lane section changes if (addLaneSectionChanges(roadIn, r, automaticWidening)) { - cerr << "ERR: error in addLaneSectionChanges"; + std::cerr << "ERR: error in addLaneSectionChanges"; return 1; } diff --git a/src/generation/buildSegments.h b/src/generation/buildSegments.h index 782d84d..4e2700a 100644 --- a/src/generation/buildSegments.h +++ b/src/generation/buildSegments.h @@ -42,8 +42,8 @@ int buildSegments(const DOMElement* rootNode, roadNetwork &data) DOMElement *roadNode = getChildWithName(rootNode, "segments"); if (roadNode == NULL) { - cerr << "ERR: 'segments' not found in input file." << endl; - cout << "ERR: 'segments' not found in input file." << endl; + std::cerr << "ERR: 'segments' not found in input file." << std::endl; + std::cout << "ERR: 'segments' not found in input file." << std::endl; return 1; } @@ -55,10 +55,10 @@ int buildSegments(const DOMElement* rootNode, roadNetwork &data) if (readNameFromNode(em) == "junction") { if(!setting.silentMode) - cout << "Processing junction" << endl; + std::cout << "Processing junction" << std::endl; if (junctionWrapper(em, data)) { - cerr << "ERR: error in junction." << endl; + std::cerr << "ERR: error in junction." << std::endl; return 1; } } @@ -66,10 +66,10 @@ int buildSegments(const DOMElement* rootNode, roadNetwork &data) if (readNameFromNode(em) == "roundabout") { if(!setting.silentMode) - cout << "Processing roundabout" << endl; + std::cout << "Processing roundabout" << std::endl; if (roundAbout(em, data)) { - cerr << "ERR: error in roundabout." << endl; + std::cerr << "ERR: error in roundabout." << std::endl; return 1; } } @@ -77,10 +77,10 @@ int buildSegments(const DOMElement* rootNode, roadNetwork &data) if (readNameFromNode(em) == "connectingRoad" ) { if(!setting.silentMode) - cout << "Processing connectingRoad" << endl; + std::cout << "Processing connectingRoad" << std::endl; if (connectingRoad(em, data)) { - cerr << "ERR: error in connectingRoad." << endl; + std::cerr << "ERR: error in connectingRoad." << std::endl; return 1; } } diff --git a/src/generation/connectingRoad.h b/src/generation/connectingRoad.h index 6faaf13..50fdd25 100644 --- a/src/generation/connectingRoad.h +++ b/src/generation/connectingRoad.h @@ -34,13 +34,13 @@ int connectingRoad(DOMElement *node, roadNetwork &data) if (!mainRoad) { - cerr << "ERR: specified road is not found."; + std::cerr << "ERR: specified road is not found.\n"; return 1; } //--- generate roads ------------------------------------------------------ if(!setting.silentMode) - cout << "\tGenerating roads" << endl; + std::cout << "\tGenerating roads" << std::endl; road r; int id = readIntAttrFromNode(mainRoad, "id"); @@ -55,12 +55,12 @@ int connectingRoad(DOMElement *node, roadNetwork &data) if (buildRoad(mainRoad, r, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(mainRoad, r, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } diff --git a/src/generation/createLaneConnection.h b/src/generation/createLaneConnection.h index 01a4416..15b08ab 100644 --- a/src/generation/createLaneConnection.h +++ b/src/generation/createLaneConnection.h @@ -29,23 +29,23 @@ extern settings setting; * @param right right roadmarking * @return int error code */ -int createLaneConnection(road &r, laneSection lS1, laneSection lS2, int from, int to, string left, string right) +int createLaneConnection(road &r, laneSection lS1, laneSection lS2, int from, int to, std::string left, std::string right) { if (from == 0 || to == 0) { - cerr << "ERR: cannot connect lane Id 0." << endl; + std::cerr << "ERR: cannot connect lane Id 0." << std::endl; return 1; } if (from > findMaxLaneId(lS1) || from < findMinLaneId(lS1)) { - cerr << "ERR: cannot connect lane Id from:" << from << endl; + std::cerr << "ERR: cannot connect lane Id from:" << from << std::endl; return 1; } if (to > findMaxLaneId(lS2) || to < findMinLaneId(lS2)) { - cerr << "ERR: cannot connect lane Id to:" << to << endl; + std::cerr << "ERR: cannot connect lane Id to:" << to << std::endl; return 1; } diff --git a/src/generation/createRoadConnection.h b/src/generation/createRoadConnection.h index 73d02b3..89c653b 100644 --- a/src/generation/createRoadConnection.h +++ b/src/generation/createRoadConnection.h @@ -28,7 +28,7 @@ extern settings setting; * @param laneMarkRight right roadmarking * @return int error code */ -int createRoadConnection(road r1, road r2, road &r, junction &junc, int fromId, int toId, string laneMarkLeft, string laneMarkRight) +int createRoadConnection(road r1, road r2, road &r, junction &junc, int fromId, int toId, std::string laneMarkLeft, std::string laneMarkRight) { laneSection lS; if (r.laneSections.size() == 0) @@ -268,7 +268,7 @@ int createRoadConnection(road r1, road r2, road &r, junction &junc, int fromId, // --- lanemarkings in crossing section ------------------------------------ if (createLaneConnection(r, lS1, lS2, fromId, toId, laneMarkLeft, laneMarkRight)) { - cerr << "Error in createLaneConnection" << endl; + std::cerr << "Error in createLaneConnection" << std::endl; exit(0); return 1; } diff --git a/src/generation/junctionWrapper.h b/src/generation/junctionWrapper.h index 11e9110..8b0c14e 100644 --- a/src/generation/junctionWrapper.h +++ b/src/generation/junctionWrapper.h @@ -47,7 +47,7 @@ int junctionWrapper(const DOMElement* node, roadNetwork &data) { if (xjunction(node, data)) { - cerr << "ERR: error in xjunction." << endl; + std::cerr << "ERR: error in xjunction." << std::endl; return 1; } } @@ -56,14 +56,14 @@ int junctionWrapper(const DOMElement* node, roadNetwork &data) if (tjunction(node, data)) { - cerr << "ERR: error in tjunction." << endl; + std::cerr << "ERR: error in tjunction." << std::endl; return 1; } } if (mode == 0) { - cerr << "ERR: junction type is not defined correct." << endl; + std::cerr << "ERR: junction type is not defined correct." << std::endl; return 1; } return 0; diff --git a/src/generation/roundAbout.h b/src/generation/roundAbout.h index 1c23d45..66caadc 100644 --- a/src/generation/roundAbout.h +++ b/src/generation/roundAbout.h @@ -41,11 +41,11 @@ int roundAbout(const DOMElement* node, roadNetwork &data) { // create segment data.nSegment++; - vector junctions; + std::vector junctions; junctionGroup juncGroup; juncGroup.id = readIntAttrFromNode(node, "id"); - juncGroup.name = "jg" + to_string(juncGroup.id); + juncGroup.name = "jg" + std::to_string(juncGroup.id); int inputSegmentId = readIntAttrFromNode(node, "id"); @@ -55,14 +55,14 @@ int roundAbout(const DOMElement* node, roadNetwork &data) if (!circleRoad) { - cerr << "ERR: circleRoad is not found."; + std::cerr << "ERR: circleRoad is not found.\n"; return 1; } // store properties of circleRoad double length = readDoubleAttrFromNode(getChildWithName(getChildWithName(circleRoad, "referenceLine"), "circle"),"length") ; double R = length / (2 * M_PI); - getChildWithName(getChildWithName(circleRoad, "referenceLine"), "circle")->setAttribute(X("R"), X(to_string(R).c_str())); + getChildWithName(getChildWithName(circleRoad, "referenceLine"), "circle")->setAttribute(X("R"), X(std::to_string(R).c_str())); double sOld; @@ -75,7 +75,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) clockwise = true; if (abs(R) < 3) { - cerr << "ERR: radius of reference road in a roundabout have to be larger than 3."; + std::cerr << "ERR: radius of reference road in a roundabout have to be larger than 3.\n"; return 1; } @@ -138,7 +138,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) if (additionalRoad == NULL) { - cerr << "ERR: specified road in intersection" << cc << " is not found."; + std::cerr << "ERR: specified road in intersection" << cc << " is not found.\n"; return 1; } @@ -172,12 +172,12 @@ int roundAbout(const DOMElement* node, roadNetwork &data) road helpAdd; if (buildRoad(circleRoad, helpMain, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (buildRoad(additionalRoad, helpAdd, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } @@ -207,7 +207,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) if (sOffMain * 2 > length / nIp) { - cerr << "Length of roundabout is too short, overlapping roads." << endl; + std::cerr << "Length of roundabout is too short, overlapping roads." << std::endl; return 1; } @@ -219,8 +219,8 @@ int roundAbout(const DOMElement* node, roadNetwork &data) //sanity checks if(sMain > length) { - throwError("Interesection point s from ref road "+ to_string(refId) - + " to add road " + to_string(adId) + " is larger than the ref road's length"); + throwError("Interesection point s from ref road "+ std::to_string(refId) + + " to add road " + std::to_string(adId) + " is larger than the ref road's length"); return 1; } //fint the length of the add road @@ -235,8 +235,8 @@ int roundAbout(const DOMElement* node, roadNetwork &data) if(sAdd > adLength) { - throwError("Interesection point s from adRoad "+ to_string(adId) - + " to ref road " + to_string(refId) + " is larger than the add road's length"); + throwError("Interesection point s from adRoad "+ std::to_string(adId) + + " to ref road " + std::to_string(refId) + " is larger than the add road's length"); return 1; } //------end sanity checks @@ -249,7 +249,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) // --- generate roads -------------------------------------------------- if(!setting.silentMode) - cout << "\tGenerating roads for Roundabout" << endl; + std::cout << "\tGenerating roads for Roundabout" << std::endl; /* \___ ____/ id: 1 id: helper @@ -280,7 +280,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) if (buildRoad(circleRoad, r1, sOld, sMain - sOffMain, dummy, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } nCount++; @@ -300,12 +300,12 @@ int roundAbout(const DOMElement* node, roadNetwork &data) r2.isConnectingRoad = true; if (buildRoad(additionalRoad, r2, sAdd + sOffAdd, INFINITY, dummy, sAdd, iPx, iPy, iPhdg + phi)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad, r2, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } nCount++; @@ -320,7 +320,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) { if (buildRoad(circleRoad, helper, sMain + sOffMain, sMain + 2 * sOffMain, dummy, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } @@ -340,7 +340,7 @@ int roundAbout(const DOMElement* node, roadNetwork &data) // ---Generating Connecting Lanes --------------------------------------- if(!setting.silentMode) - cout << "\tGenerating Connecting Lanes" << endl; + std::cout << "\tGenerating Connecting Lanes" << std::endl; // max and min id's of laneSections int inner1, outer1, outer2, inner2, nLane; diff --git a/src/generation/tjunction.h b/src/generation/tjunction.h index dcdc445..fa0ec13 100644 --- a/src/generation/tjunction.h +++ b/src/generation/tjunction.h @@ -34,7 +34,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) mode = 2; if (mode == 0) { - cerr << "ERR: junction type is not defined correctly." << endl; + std::cerr << "ERR: junction type is not defined correctly." << std::endl; return 1; } @@ -58,7 +58,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) DOMElement* iP = getChildWithName(node, "intersectionPoint"); if (iP == NULL) { - cerr << "ERR: intersection point is not defined correct." << endl; + std::cerr << "ERR: intersection point is not defined correct." << std::endl; return 1; } DOMElement* cA = getChildWithName(getChildWithName(node, "coupler"), "junctionArea"); @@ -92,7 +92,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (mainRoad == NULL || additionalRoad1 == NULL || (mode == 2 && additionalRoad2 == NULL)) { - cerr << "ERR: specified roads in intersection are not found."; + std::cerr << "ERR: specified roads in intersection are not found.\n"; return 1; } @@ -125,21 +125,21 @@ int tjunction(const DOMElement* node, roadNetwork &data) road help1; if (buildRoad(mainRoad, help1, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } road help2; if (buildRoad(additionalRoad1, help2, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } road help3; if (buildRoad(additionalRoad2, help3, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } @@ -154,9 +154,9 @@ int tjunction(const DOMElement* node, roadNetwork &data) double width3 = abs(findTOffset(lS3, findMinLaneId(lS3), 0)) + abs(findTOffset(lS3, findMaxLaneId(lS3), 0)); // check offsets and adjust them if necessary (here: 4 is safty factor) - double w1 = max(width2 / 2, width3 / 2) * 4; - double w2 = max(width1 / 2, width3 / 2) * 4; - double w3 = max(width1 / 2, width2 / 2) * 4; + double w1 = std::max(width2 / 2, width3 / 2) * 4; + double w2 = std::max(width1 / 2, width3 / 2) * 4; + double w3 = std::max(width1 / 2, width2 / 2) * 4; bool changed = false; if (sOffMain < w1) @@ -177,7 +177,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (changed) { - cerr << "!!! sOffset of at least one road was changed, due to feasible road structure !!!" << endl; + std::cerr << "!!! sOffset of at least one road was changed, due to feasible road structure !!!" << std::endl; } // calculate s and phi at intersection @@ -188,7 +188,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) tmpNode = getChildWithName(iP, "adRoad"); if (tmpNode == NULL) { - cerr << "ERR: first 'adRoad' is missing." << endl; + std::cerr << "ERR: first 'adRoad' is missing." << std::endl; return 1; } sAdd1 = readDoubleAttrFromNode(tmpNode, "s"); @@ -202,7 +202,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (tmpNode == NULL) { - cerr << "ERR: second 'adRoad' is missing." << endl; + std::cerr << "ERR: second 'adRoad' is missing." << std::endl; return 1; } sAdd2 = readDoubleAttrFromNode(tmpNode, "s"); @@ -222,7 +222,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) __________ ___________ */ if(!setting.silentMode) - cout << "\tGenerating roads" << endl; + std::cout << "\tGenerating roads" << std::endl; laneSection lS; double t; @@ -242,14 +242,14 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (phi > 0) if (buildRoad(mainRoad, r1, sMain - sOffMain, 0, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } // add street is right from road 1 if (phi < 0) if (buildRoad(mainRoad, r1, sMain - sOffMain, 0, automaticRestricted, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } @@ -257,14 +257,14 @@ int tjunction(const DOMElement* node, roadNetwork &data) { if (buildRoad(mainRoad, r1, sMain + sOffMain, INFINITY, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } if (addObjects(mainRoad, r1, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } @@ -284,19 +284,19 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (phi > 0) if (buildRoad(mainRoad, r2, sMain + sOffMain, INFINITY, automaticRestricted, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } // add street is right from road 1 if (phi < 0) if (buildRoad(mainRoad, r2, sMain + sOffMain, INFINITY, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(mainRoad, r2, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -304,12 +304,12 @@ int tjunction(const DOMElement* node, roadNetwork &data) { if (buildRoad(additionalRoad1, r2, sAdd1 + sOffAdd1, INFINITY, automaticWidening, sAdd1, iPx, iPy, iPhdg + phi1)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad1, r2, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -325,12 +325,12 @@ int tjunction(const DOMElement* node, roadNetwork &data) { if (buildRoad(additionalRoad1, r3, sAdd1 + sOffAdd1, INFINITY, automaticWidening, sAdd1, iPx, iPy, iPhdg + phi1)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad1, r3, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -338,12 +338,12 @@ int tjunction(const DOMElement* node, roadNetwork &data) { if (buildRoad(additionalRoad2, r3, sAdd2 + sOffAdd2, INFINITY, automaticWidening, sAdd2, iPx, iPy, iPhdg + phi2)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad2, r3, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -372,7 +372,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) length = readDoubleAttrFromNode(addLane, "ds"); int type; - string tmpType = readStrAttrFromNode(addLane, "type"); + std::string tmpType = readStrAttrFromNode(addLane, "type"); if (tmpType == "left") type = 1; if (tmpType == "right") @@ -389,7 +389,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) int inputId = readIntAttrFromNode(addLane, "roadId"); - string inputPos = "end"; + std::string inputPos = "end"; if (attributeExits(addLane, "roadPos")) inputPos = readStrAttrFromNode(addLane, "roadPos"); @@ -446,7 +446,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) // ---Generating Connecting Lanes ------------------------------------------- if(!setting.silentMode) - cout << "\tGenerating Connecting Lanes" << endl; + std::cout << "\tGenerating Connecting Lanes" << std::endl; // --- generate user-defined connecting lanes if (con != NULL && readStrAttrFromNode(con, "type") == "single") @@ -458,11 +458,11 @@ int tjunction(const DOMElement* node, roadNetwork &data) int fromId = readIntAttrFromNode(roadLink, "fromId"); int toId = readIntAttrFromNode(roadLink, "toId"); - string fromPos = "end"; + std::string fromPos = "end"; if (attributeExits(roadLink, "fromPos")) fromPos = readStrAttrFromNode(roadLink, "fromPos"); - string toPos = "end"; + std::string toPos = "end"; if (attributeExits(roadLink,"toPos")) toPos = readStrAttrFromNode(roadLink, "toPos"); @@ -477,8 +477,8 @@ int tjunction(const DOMElement* node, roadNetwork &data) } if (r1.id == -1 || r2.id == -1) { - cerr << "ERR: error in user-defined lane connecting:" << endl; - cerr << "\t road to 'fromId' or 'toId' can not be found" << endl; + std::cerr << "ERR: error in user-defined lane connecting:" << std::endl; + std::cerr << "\t road to 'fromId' or 'toId' can not be found" << std::endl; return 1; } @@ -494,8 +494,8 @@ int tjunction(const DOMElement* node, roadNetwork &data) if (toPos == "end") to *= -1; - string left = sol; - string right = sol; + std::string left = sol; + std::string right = sol; if (attributeExits(laneLink, "left")) left = readStrAttrFromNode(laneLink, "left"); @@ -515,10 +515,10 @@ int tjunction(const DOMElement* node, roadNetwork &data) // generate automatic connecting lanes else { - // switch roads if necessary, so that + // switch roads if necessary if (sortRoads(r1, r2, r3)) { - cerr << "ERR: roads can not be sorted." << endl; + std::cerr << "ERR: roads can not be sorted." << std::endl; return 1; } @@ -529,7 +529,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) // 1) PART from R1 To R2 -> Right to Right (if exist) calcFromTo(r1, r2, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -559,7 +559,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) calcFromTo(r2, r1, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -584,7 +584,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) calcFromTo(r2, r3, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -607,7 +607,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) calcFromTo(r3, r2, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -626,7 +626,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) calcFromTo(r3, r1, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -656,7 +656,7 @@ int tjunction(const DOMElement* node, roadNetwork &data) calcFromTo(r1, r3, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; diff --git a/src/generation/xjunction.h b/src/generation/xjunction.h index c12e9a5..398b515 100644 --- a/src/generation/xjunction.h +++ b/src/generation/xjunction.h @@ -28,7 +28,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { // check type of the junction (here: M = mainroad, A = accessroad) int mode = 0; - string type = readStrAttrFromNode(domNode, "type"); + std::string type = readStrAttrFromNode(domNode, "type"); if (type == "2M") mode = 1; if (type == "M2A") @@ -37,7 +37,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) mode = 3; if (mode == 0) { - cerr << "ERR: junction type is not defined correct." << endl; + std::cerr << "ERR: junction type is not defined correct." << std::endl; return 1; } @@ -56,7 +56,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) DOMElement* iP = getChildWithName(domNode, "intersectionPoint"); if (iP == NULL) { - cerr << "ERR: intersection point is not defined correct."; + std::cerr << "ERR: intersection point is not defined correct."; return 1; } DOMElement* cA = getChildWithName(getChildWithName(domNode, "coupler"), "junctionArea"); @@ -94,7 +94,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) if (!refRoad || (mode >= 1 && !additionalRoad1) || (mode >= 2 && !additionalRoad2) || (mode >= 3 && !additionalRoad3)) { - cerr << "ERR: specified roads in intersection are not found." << endl; + std::cerr << "ERR: specified roads in intersection are not found." << std::endl; return 1; } @@ -134,7 +134,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) road help1; if (buildRoad(refRoad, help1, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } @@ -142,21 +142,21 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) road help2; if (buildRoad(additionalRoad1, help2, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } road help3; if (buildRoad(additionalRoad2, help3, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } road help4; if (buildRoad(additionalRoad3, help4, 0, INFINITY, dummy, 0, 0, 0, 0)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } @@ -174,10 +174,10 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) double width4 = abs(findTOffset(lS4, findMinLaneId(lS4), 0)) + abs(findTOffset(lS4, findMaxLaneId(lS4), 0)); // check offsets and adjust them if necessary (here: 4 is safty factor) - double w1 = max(width2 / 2, max(width3 / 2, width4 / 2)) * 4; - double w2 = max(width1 / 2, max(width3 / 2, width4 / 2)) * 4; - double w3 = max(width1 / 2, max(width2 / 2, width4 / 2)) * 4; - double w4 = max(width1 / 2, max(width2 / 2, width3 / 2)) * 4; + double w1 = std::max(width2 / 2, std::max(width3 / 2, width4 / 2)) * 4; + double w2 = std::max(width1 / 2, std::max(width3 / 2, width4 / 2)) * 4; + double w3 = std::max(width1 / 2, std::max(width2 / 2, width4 / 2)) * 4; + double w4 = std::max(width1 / 2, std::max(width2 / 2, width3 / 2)) * 4; bool changed = false; if (sOffMain < w1) @@ -203,7 +203,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) if (changed) { - cerr << "!!! sOffset of at least one road was changed, due to feasible road structure !!!" << endl; + std::cerr << "!!! sOffset of at least one road was changed, due to feasible road structure !!!" << std::endl; } // calculate s and phi at intersection @@ -214,7 +214,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) tmpNode = getChildWithName(iP, "adRoad"); if (tmpNode == NULL) { - cerr << "ERR: first 'adRoad' is missing." << endl; + std::cerr << "ERR: first 'adRoad' is missing." << std::endl; return 1; } sAdd1 = readDoubleAttrFromNode(tmpNode, "s"); @@ -225,30 +225,30 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) //some sanity checks--- if (tmpNode == NULL && mode != 1) //2M (=mode1) does not contain adRoads { - cerr << "ERR: error in generating junction road (mode 1). AdRoad is missing in intersection point" << endl; + std::cerr << "ERR: error in generating junction road (mode 1). AdRoad is missing in intersection point" << std::endl; return 1; } if(sAdd1 - sOffAdd1 <= 0) { - cerr << "ERR: error in generating junction road. Intersection point is too close to add. road start" << endl; + std::cerr << "ERR: error in generating junction road. Intersection point is too close to add. road start" << std::endl; return 1; } if(sAdd1 > help2.length) { - cerr << "ERR: error in generating junction road. Intersection point is too close to add. road end " << endl; + std::cerr << "ERR: error in generating junction road. Intersection point is too close to add. road end " << std::endl; return 1; } if(sMain > help1.length) { - cerr << "ERR: error in generating junction road. Intersection point is too close to main road end " << endl; + std::cerr << "ERR: error in generating junction road. Intersection point is too close to main road end " << std::endl; return 1; } if(sMain <= sOffMain) { - cerr << "ERR: error in generating junction road. Intersection point is too close to main road start " << endl; + std::cerr << "ERR: error in generating junction road. Intersection point is too close to main road start " << std::endl; return 1; } @@ -258,7 +258,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (tmpNode == NULL) { - cerr << "ERR: second 'adRoad' is missing." << endl; + std::cerr << "ERR: second 'adRoad' is missing." << std::endl; return 1; } @@ -272,7 +272,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (!tmpNode) { - cerr << "ERR: third 'adRoad' is missing." << endl; + std::cerr << "ERR: third 'adRoad' is missing." << std::endl; return 1; } sAdd3 = readDoubleAttrFromNode(tmpNode, "s"); @@ -298,7 +298,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) | | */ if(!setting.silentMode) - cout << "\tGenerating roads" << endl; + std::cout << "\tGenerating roads" << std::endl; road r1; r1.id = 100 * junc.id + 1; @@ -312,7 +312,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(refRoad, r1, sMain - sOffMain, 0, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } @@ -320,14 +320,14 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(refRoad, r1, sMain + sOffMain, INFINITY, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } if (addObjects(refRoad, r1, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } @@ -343,7 +343,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) if (buildRoad(additionalRoad1, r2, sAdd1 - sOffAdd1, 0, automaticWidening, sAdd1, iPx, iPy, iPhdg + phi1)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } @@ -351,14 +351,14 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(additionalRoad1, r2, sAdd1 + sOffAdd1, INFINITY, automaticWidening, sAdd1, iPx, iPy, iPhdg + phi1)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } } if (addObjects(additionalRoad1, r2, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } @@ -374,12 +374,12 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(refRoad, r3, sMain + sOffMain, INFINITY, automaticWidening, sMain, iPx, iPy, iPhdg)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(refRoad, r3, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -387,12 +387,12 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(additionalRoad2, r3, sAdd2 + sOffAdd2, INFINITY, automaticWidening, sAdd2, iPx, iPy, iPhdg + phi2)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad2, r3, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -415,12 +415,12 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(additionalRoad1, r4, sAdd1 + sOffAdd1, INFINITY, automaticWidening, sAdd1, iPx, iPy, iPhdg + phi1)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad1, r4, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -428,12 +428,12 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(additionalRoad2, r4, sAdd2 + sOffAdd2, INFINITY, automaticWidening, sAdd2, iPx, iPy, iPhdg + phi2)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad2, r4, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -441,12 +441,12 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) { if (buildRoad(additionalRoad3, r4, sAdd3 + sOffAdd3, INFINITY, automaticWidening, sAdd3, iPx, iPy, iPhdg + phi3)) { - cerr << "ERR: error in buildRoad" << endl; + std::cerr << "ERR: error in buildRoad" << std::endl; return 1; } if (addObjects(additionalRoad3, r4, data)) { - cerr << "ERR: error in addObjects" << endl; + std::cerr << "ERR: error in addObjects" << std::endl; return 1; } } @@ -477,7 +477,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) length = readDoubleAttrFromNode(addLane, "ds"); int type; - string tmpType = readStrAttrFromNode(addLane, "type"); + std::string tmpType = readStrAttrFromNode(addLane, "type"); if (tmpType == "left") type = 1; if (tmpType == "right") @@ -494,7 +494,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) int inputId = readIntAttrFromNode(addLane, "roadId"); - string inputPos = "end"; + std::string inputPos = "end"; if (attributeExits(addLane, "roadPos")) inputPos = readStrAttrFromNode(addLane, "roadPos"); @@ -565,7 +565,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) // ---Generating Connecting Lanes ------------------------------------------- if(!setting.silentMode) - cout << "\tGenerating Connecting Lanes" << endl; + std::cout << "\tGenerating Connecting Lanes" << std::endl; // generate user-defined connecting lanes if (con != NULL && readStrAttrFromNode(con, "type") == "single") @@ -580,11 +580,11 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) int fromId = readIntAttrFromNode(roadLink, "fromId"); int toId = readIntAttrFromNode(roadLink, "toId"); - string fromPos = "end"; + std::string fromPos = "end"; if (attributeExits(roadLink, "fromPos")) fromPos = readIntAttrFromNode(roadLink, "fromPos"); - string toPos = "end"; + std::string toPos = "end"; if (attributeExits(roadLink, "toPos")) toPos = readIntAttrFromNode(roadLink, "toPos"); @@ -599,8 +599,8 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) } if (r1.id == -1 || r2.id == -1) { - cerr << "ERR: error in user-defined lane connecting:" << endl; - cerr << "\t road to 'fromId' or 'toId' can not be found" << endl; + std::cerr << "ERR: error in user-defined lane connecting:" << std::endl; + std::cerr << "\t road to 'fromId' or 'toId' can not be found" << std::endl; return 1; } @@ -620,8 +620,8 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) if (toPos == "end") to *= -1; - string left = non; - string right = non; + std::string left = non; + std::string right = non; if (attributeExits(laneLink, "left")) left = readStrAttrFromNode(laneLink, "left"); @@ -643,7 +643,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) // switch roads if necessary, so that the angle to refRoad increases if (sortRoads(r1, r2, r3, r4)) { - cerr << "ERR: roads can not be sorted." << endl; + std::cerr << "ERR: roads can not be sorted." << std::endl; return 1; } @@ -655,7 +655,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r1, r3, from, to, nF, nT, 0); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -677,7 +677,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r2, r4, from, to, nF, nT, 0); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -696,7 +696,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r3, r1, from, to, nF, nT, 0); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -718,7 +718,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r4, r2, from, to, nF, nT, 0); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -737,7 +737,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r1, r2, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -759,7 +759,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r2, r1, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -778,7 +778,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r2, r3, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -800,7 +800,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r3, r2, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -819,7 +819,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r3, r4, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -841,7 +841,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r4, r3, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -860,7 +860,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r4, r1, from, to, nF, nT, -1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; @@ -882,7 +882,7 @@ int xjunction(const DOMElement* domNode, roadNetwork &data) calcFromTo(r1, r4, from, to, nF, nT, 1); - for (int i = 0; i < min(nF, nT); i++) + for (int i = 0; i < std::min(nF, nT); i++) { road r; r.inputSegmentId = inputSegmentId; diff --git a/src/libfiles/export.cpp b/src/libfiles/export.cpp index 1ae0d44..1aec3e0 100644 --- a/src/libfiles/export.cpp +++ b/src/libfiles/export.cpp @@ -77,7 +77,7 @@ EXPORTED int executePipeline(char* file) { if (file == NULL){ - cout << "ERR: no file has been provided!" << endl; + std::cout << "ERR: no file has been provided!" << std::endl; return -1; } @@ -86,7 +86,7 @@ EXPORTED int executePipeline(char* file) xmlTree inputxml; roadNetwork data; - string outputFile = setting.outname; + std::string outputFile = setting.outname; char dt[100];//stores timestamp as string data.outputFile = outputFile.substr(0, outputFile.find(".xml")); @@ -102,15 +102,15 @@ EXPORTED int executePipeline(char* file) getTimeStamp(dt); - cerr << "\n" << dt << " Error log for run with attribute: " << file << endl; + std::cerr << "\n" << dt << " Error log for run with attribute: " << file << std::endl; if (setting.xmlSchemaLocation == ""){ - cerr << "ERR: xml scheme NOT SET" << endl; + std::cerr << "ERR: xml scheme NOT SET" << std::endl; return -1; } if(!setting.silentMode){ - cout << file << endl; + std::cout << file << std::endl; printLogo(); } @@ -120,35 +120,35 @@ EXPORTED int executePipeline(char* file) if (validateInput(file, inputxml)) { - cerr << "ERR: error in validateInput" << endl; + std::cerr << "ERR: error in validateInput" << std::endl; return -1; } if (buildSegments(inputxml.getRootElement(), data)) { - cerr << "ERR: error in buildSegments" << endl; + std::cerr << "ERR: error in buildSegments" << std::endl; return -1; } if (linkSegments(inputxml.getRootElement(), data)) { - cerr << "ERR: error in linkSegments" << endl; + std::cerr << "ERR: error in linkSegments" << std::endl; return -1; } if (closeRoadNetwork(inputxml.getRootElement(), data)) { - cerr << "ERR: error in closeRoadNetwork" << endl; + std::cerr << "ERR: error in closeRoadNetwork" << std::endl; return -1; } if (createXMLXercesC(data)) { - cerr << "ERR: error during createXML" << endl; + std::cerr << "ERR: error during createXML" << std::endl; return -1; } if (validateOutput(data)) { - cerr << "ERR: error in validateOutput" << endl; + std::cerr << "ERR: error in validateOutput" << std::endl; return -1; } @@ -157,9 +157,9 @@ EXPORTED int executePipeline(char* file) { if(setting.warnings > 0) { - cout << "\nFinished with " << setting.warnings << " warning(s), check out the error log for more information." << endl; + std::cout << "\nFinished with " << setting.warnings << " warning(s), check out the error log for more information." << std::endl; }else{ - cout <<"\nFinished successfully" << endl; + std::cout <<"\nFinished successfully" << std::endl; } } diff --git a/src/utils/geometries.h b/src/utils/geometries.h index 1278f8e..fe5939f 100644 --- a/src/utils/geometries.h +++ b/src/utils/geometries.h @@ -27,7 +27,7 @@ * @param phi2 angle of end point (not used here) * @return int error code */ -int addLine(vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) +int addLine(std::vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) { geometry g; @@ -60,7 +60,7 @@ int addLine(vector &geo, double x1, double y1, double phi1, double x2, * @param phi2 angle of end point * @return int error code */ -int addArc(vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) +int addArc(std::vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) { double a = phi2 - phi1; fixAngle(a); @@ -101,7 +101,7 @@ int addArc(vector &geo, double x1, double y1, double phi1, double x2, * @param phi2 angle of end point * @return int error code */ -int addCompositeCurve(vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) +int addCompositeCurve(std::vector &geo, double x1, double y1, double phi1, double x2, double y2, double phi2) { // not yet implemented return 0; diff --git a/src/utils/xml.h b/src/utils/xml.h index f73b2ff..e25dfcb 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -26,7 +26,6 @@ #include "xmlParser.h" using namespace XERCES_CPP_NAMESPACE; -using namespace std; using namespace xercesc; extern settings setting; @@ -40,13 +39,13 @@ extern settings setting; int validateInput(char *file, xmlTree &xmlInput) { - string schema = string_format("%s/xml/input.xsd", PROJ_DIR); + std::string schema = string_format("%s/xml/input.xsd", PROJ_DIR); const char *schema_file = schema.c_str(); const char *xml_file = file; if (xmlInput.loadGrammar(schema_file) == NULL) { - cerr << "ERR: couldn't load schema" << endl; + std::cerr << "ERR: couldn't load schema" << std::endl; return 1; } @@ -54,11 +53,11 @@ int validateInput(char *file, xmlTree &xmlInput) if (xmlInput.getErrorCount() == 0){ if(!setting.silentMode) - cout << "XML input file validated against the schema successfully" << endl; + std::cout << "XML input file validated against the schema successfully" << std::endl; } else { - cerr << "ERR: XML input file doesn't conform to the schema" << endl; + std::cerr << "ERR: XML input file doesn't conform to the schema" << std::endl; return 1; } @@ -74,22 +73,22 @@ int validateInput(char *file, xmlTree &xmlInput) int validateOutput(roadNetwork &data) { if(!setting.silentMode) - cout << "Validating output" << endl; + std::cout << "Validating output" << std::endl; // setup file - string file = data.outputFile; + std::string file = data.outputFile; file.append(".xodr"); const char *xml_file = file.c_str(); XMLPlatformUtils::Initialize(); - string schema = string_format("%s/xml/output.xsd", PROJ_DIR); + std::string schema = string_format("%s/xml/output.xsd", PROJ_DIR); const char *schema_path = schema.c_str(); // load output file XercesDOMParser domParser; if (domParser.loadGrammar(schema_path, Grammar::SchemaGrammarType) == NULL) { - cerr << "ERR: couldn't load schema" << endl; + std::cerr << "ERR: couldn't load schema" << std::endl; return 1; } //create error handler from custom error handler class @@ -108,11 +107,11 @@ int validateOutput(roadNetwork &data) domParser.parse(xml_file); if (domParser.getErrorCount() == 0){ if(!setting.silentMode) - cout << "XML output file validated against the schema successfully" << endl; + std::cout << "XML output file validated against the schema successfully" << std::endl; } else { - cerr << "ERR: XML output file doesn't conform to the schema" << endl; + std::cerr << "ERR: XML output file doesn't conform to the schema" << std::endl; return 1; } @@ -163,12 +162,12 @@ int createXMLXercesC(roadNetwork &data) nodeElement header("header"); - header.addAttribute("revMajor", to_string(setting.versionMajor).c_str()); - header.addAttribute("revMinor", to_string(setting.versionMinor).c_str()); - header.addAttribute("north", to_string(setting.north).c_str()); - header.addAttribute("south", to_string(setting.south).c_str()); - header.addAttribute("west", to_string(setting.west).c_str()); - header.addAttribute("east", to_string(setting.east).c_str()); + header.addAttribute("revMajor", std::to_string(setting.versionMajor).c_str()); + header.addAttribute("revMinor", std::to_string(setting.versionMinor).c_str()); + header.addAttribute("north", std::to_string(setting.north).c_str()); + header.addAttribute("south", std::to_string(setting.south).c_str()); + header.addAttribute("west", std::to_string(setting.west).c_str()); + header.addAttribute("east", std::to_string(setting.east).c_str()); header.appendToNode(root); // geoReference tag @@ -499,10 +498,10 @@ int createXMLXercesC(roadNetwork &data) */ int printLogo() { - cout << "|‾\\ /‾\\ |‾‾| |‾\\ /‾‾ |‾‾ |\\ | |‾‾ |‾\\ |‾‾| ‾|‾ | /‾\\ |\\ |" << endl; - cout << "|_/ | | |--| | | - | _ |-- | | | |-- |_/ |--| | | | | | | |" << endl; - cout << "| \\ \\_/ | | |_/ \\_/ |__ | \\| |__ | \\ | | | | \\_/ | \\|" << endl; - cout << "=======================================================================" << endl; + std::cout << "|‾\\ /‾\\ |‾‾| |‾\\ /‾‾ |‾‾ |\\ | |‾‾ |‾\\ |‾‾| ‾|‾ | /‾\\ |\\ |" << std::endl; + std::cout << "|_/ | | |--| | | - | _ |-- | | | |-- |_/ |--| | | | | | | |" << std::endl; + std::cout << "| \\ \\_/ | | |_/ \\_/ |__ | \\| |__ | \\ | | | | \\_/ | \\|" << std::endl; + std::cout << "=======================================================================" << std::endl; return 0; } \ No newline at end of file