|
23 | 23 |
|
24 | 24 | #include <string> |
25 | 25 | #include <vector> |
26 | | -#include <map> |
27 | 26 |
|
28 | 27 | #include <boost/optional.hpp> |
29 | 28 |
|
30 | 29 | #include "../ifcparse/IfcUtil.h" |
31 | 30 | #include "../ifcparse/IfcException.h" |
32 | 31 | #include "../ifcparse/%(schema_name)senum.h" |
33 | 32 |
|
| 33 | +#ifdef _MSC_VER |
| 34 | +#pragma warning(push) |
| 35 | +#pragma warning(disable : 4100) |
| 36 | +#endif |
| 37 | +
|
34 | 38 | #define IfcSchema %(schema_name)s |
35 | 39 |
|
36 | 40 | namespace %(schema_name)s { |
|
47 | 51 | IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0); |
48 | 52 | } |
49 | 53 |
|
| 54 | +#ifdef _MSC_VER |
| 55 | +#pragma warning(pop) |
| 56 | +#endif |
| 57 | +
|
50 | 58 | #endif |
51 | 59 | """ |
52 | 60 |
|
|
107 | 115 | #include "../ifcparse/IfcWrite.h" |
108 | 116 | #include "../ifcparse/IfcWritableEntity.h" |
109 | 117 |
|
| 118 | +#include <map> |
| 119 | +
|
110 | 120 | using namespace %(schema_name)s; |
111 | 121 | using namespace IfcParse; |
112 | 122 | using namespace IfcWrite; |
|
261 | 271 | } |
262 | 272 |
|
263 | 273 | std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::string& a) { |
264 | | - if (inverse_map.empty()) ::InitInverseMap(); |
265 | | - inverse_map_t::const_iterator it; |
266 | | - inverse_map_t::mapped_type::const_iterator jt; |
267 | | - while (true) { |
| 274 | + if (inverse_map.empty()) ::InitInverseMap(); |
| 275 | + inverse_map_t::const_iterator it; |
| 276 | + inverse_map_t::mapped_type::const_iterator jt; |
| 277 | + for(;;) { |
268 | 278 | it = inverse_map.find(t); |
269 | 279 | if (it != inverse_map.end()) { |
270 | | - jt = it->second.find(a); |
271 | | - if (jt != it->second.end()) { |
272 | | - return jt->second; |
273 | | - } |
274 | | - } |
| 280 | + jt = it->second.find(a); |
| 281 | + if (jt != it->second.end()) { |
| 282 | + return jt->second; |
| 283 | + } |
| 284 | + } |
275 | 285 | if ((t = Parent(t)) == -1) break; |
276 | 286 | } |
277 | 287 | throw IfcException("Attribute not found"); |
278 | 288 | } |
279 | 289 |
|
280 | 290 | std::set<std::string> Type::GetInverseAttributeNames(Enum t) { |
281 | | - if (inverse_map.empty()) ::InitInverseMap(); |
282 | | - inverse_map_t::const_iterator it; |
283 | | - inverse_map_t::mapped_type::const_iterator jt; |
| 291 | + if (inverse_map.empty()) ::InitInverseMap(); |
| 292 | + inverse_map_t::const_iterator it; |
| 293 | + inverse_map_t::mapped_type::const_iterator jt; |
284 | 294 |
|
285 | | - std::set<std::string> return_value; |
| 295 | + std::set<std::string> return_value; |
286 | 296 |
|
287 | | - while (true) { |
| 297 | + for (;;) { |
288 | 298 | it = inverse_map.find(t); |
289 | 299 | if (it != inverse_map.end()) { |
290 | | - for (jt = it->second.begin(); jt != it->second.end(); ++jt) { |
291 | | - return_value.insert(jt->first); |
292 | | - } |
293 | | - } |
| 300 | + for (jt = it->second.begin(); jt != it->second.end(); ++jt) { |
| 301 | + return_value.insert(jt->first); |
| 302 | + } |
| 303 | + } |
294 | 304 | if ((t = Parent(t)) == -1) break; |
295 | 305 | } |
296 | | - |
297 | | - return return_value; |
| 306 | +
|
| 307 | + return return_value; |
298 | 308 | } |
299 | 309 |
|
300 | 310 | void Type::PopulateDerivedFields(IfcWrite::IfcWritableEntity* e) { |
301 | 311 | std::map<Type::Enum, std::set<int> >::const_iterator i = derived_map.find(e->type()); |
302 | | - if (i != derived_map.end()) { |
303 | | - for (std::set<int>::const_iterator it = i->second.begin(); it != i->second.end(); ++it) { |
304 | | - e->setArgumentDerived(*it); |
305 | | - } |
306 | | - } |
| 312 | + if (i != derived_map.end()) { |
| 313 | + for (std::set<int>::const_iterator it = i->second.begin(); it != i->second.end(); ++it) { |
| 314 | + e->setArgumentDerived(*it); |
| 315 | + } |
| 316 | + } |
307 | 317 | } |
308 | 318 | """ |
309 | 319 |
|
|
0 commit comments