43 #ifdef CHECK_MEMORY_LEAKS
45 #endif // CHECK_MEMORY_LEAKS
124 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
129 if (ret.length() > 0) {
130 return ret.substr(1);
143 std::vector<std::string>
147 std::vector<std::string> result;
148 for (std::vector<std::string>::const_iterator it = classNames.begin(); it != classNames.end(); it++) {
150 if ((svc & permissions) == svc && svc !=
SVC_UNKNOWN) {
151 result.push_back(*it);
158 std::pair<std::string, bool>
162 return std::pair<std::string, bool>(
"",
false);
165 size_t num_allowed = 0;
167 if ((mask & permissions) == mask) {
184 throw ProcessError(
"Unknown vehicle class '" + name +
"'.");
192 for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
193 if (name.find(*it) != std::string::npos) {
225 if (allowedS.size() == 0 && disallowedS.size() == 0) {
227 }
else if (allowedS.size() > 0 && disallowedS.size() > 0) {
228 WRITE_WARNING(
"SVCPermissions must be specified either via 'allow' or 'disallow'. Ignoring 'disallow'");
230 }
else if (allowedS.size() > 0) {
241 for (std::vector<std::string>::const_iterator i = allowedS.begin(); i != allowedS.end(); ++i) {
253 throw ProcessError(
"Unknown vehicle shape '" + name +
"'.");
266 return (permissions & anyRail) > 0 && (permissions &
SVC_PASSENGER) == 0;
275 }
else if (name ==
"zero") {
277 }
else if (name.find(
"HDV_3_") == 0) {
279 }
else if (name.find(
"HDV_6_") == 0) {
281 }
else if (name.find(
"HDV_12_") == 0) {
283 }
else if (name.find(
"P_7_") == 0) {
285 }
else if (name.find(
"P_14_") == 0) {
287 }
else if (name.find(
"HDV_A0_3_") == 0) {
289 }
else if (name.find(
"HDV_A0_6_") == 0) {
291 }
else if (name.find(
"HDV_A0_12_") == 0) {
293 }
else if (name.find(
"P_A0_7_") == 0) {
295 }
else if (name.find(
"P_A0_14_") == 0) {
300 throw ProcessError(
"Unknown emission type '" + name +
"'.");
312 return "HDV_3_" +
toString(
int(
id));
313 }
else if (
id < 3 + 6) {
314 return "HDV_6_" +
toString(
int(
id - 3));
315 }
else if (
id < 3 + 6 + 12) {
316 return "HDV_12_" +
toString(
int(
id - 3 - 6));
317 }
else if (
id < 3 + 6 + 12 + 7) {
318 return "P_7_" +
toString(
int(
id - 3 - 6 - 12));
319 }
else if (
id < 3 + 6 + 12 + 7 + 14) {
320 return "P_14_" +
toString(
int(
id - 3 - 6 - 12 - 7));