mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 18:46:23 +00:00
templates.py: disable C4100 warnings for headers created by this file + move <map> inclusion to .cpp as it's not needed in .h + use spaces instead of tabs consistently for these files as seems to be the convention.
This commit is contained in:
@@ -4,6 +4,8 @@ the IFC schema and will most likely fail on any other Express schema.
|
|||||||
|
|
||||||
The code can be invoked in the following way and results in two header files
|
The code can be invoked in the following way and results in two header files
|
||||||
and a single implementation file named according to the schema name in the
|
and a single implementation file named according to the schema name in the
|
||||||
Express file. A python 3 interpreter with the pyparsing library is required.
|
Express file. A python 3 interpreter with the pyparsing [1] library is required.
|
||||||
|
|
||||||
$ python bootstrap.py express.bnf > express_parser.py && python express_parser.py IFC2X3_TC1.exp
|
$ python bootstrap.py express.bnf > express_parser.py && python express_parser.py IFC2X3_TC1.exp
|
||||||
|
|
||||||
|
[1] http://pyparsing.wikispaces.com/Download+and+Installation
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ header = """
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
@@ -31,6 +30,11 @@ header = """
|
|||||||
#include "../ifcparse/IfcException.h"
|
#include "../ifcparse/IfcException.h"
|
||||||
#include "../ifcparse/%(schema_name)senum.h"
|
#include "../ifcparse/%(schema_name)senum.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4100)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IfcSchema %(schema_name)s
|
#define IfcSchema %(schema_name)s
|
||||||
|
|
||||||
namespace %(schema_name)s {
|
namespace %(schema_name)s {
|
||||||
@@ -47,6 +51,10 @@ void InitStringMap();
|
|||||||
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -107,6 +115,8 @@ implementation= """
|
|||||||
#include "../ifcparse/IfcWrite.h"
|
#include "../ifcparse/IfcWrite.h"
|
||||||
#include "../ifcparse/IfcWritableEntity.h"
|
#include "../ifcparse/IfcWritableEntity.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
using namespace %(schema_name)s;
|
using namespace %(schema_name)s;
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
@@ -264,7 +274,7 @@ std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::str
|
|||||||
if (inverse_map.empty()) ::InitInverseMap();
|
if (inverse_map.empty()) ::InitInverseMap();
|
||||||
inverse_map_t::const_iterator it;
|
inverse_map_t::const_iterator it;
|
||||||
inverse_map_t::mapped_type::const_iterator jt;
|
inverse_map_t::mapped_type::const_iterator jt;
|
||||||
while (true) {
|
for(;;) {
|
||||||
it = inverse_map.find(t);
|
it = inverse_map.find(t);
|
||||||
if (it != inverse_map.end()) {
|
if (it != inverse_map.end()) {
|
||||||
jt = it->second.find(a);
|
jt = it->second.find(a);
|
||||||
@@ -284,7 +294,7 @@ std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
|
|||||||
|
|
||||||
std::set<std::string> return_value;
|
std::set<std::string> return_value;
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
it = inverse_map.find(t);
|
it = inverse_map.find(t);
|
||||||
if (it != inverse_map.end()) {
|
if (it != inverse_map.end()) {
|
||||||
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
|
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#include "../ifcparse/IfcWrite.h"
|
#include "../ifcparse/IfcWrite.h"
|
||||||
#include "../ifcparse/IfcWritableEntity.h"
|
#include "../ifcparse/IfcWritableEntity.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
using namespace Ifc2x3;
|
using namespace Ifc2x3;
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
@@ -37,6 +36,11 @@
|
|||||||
#include "../ifcparse/IfcException.h"
|
#include "../ifcparse/IfcException.h"
|
||||||
#include "../ifcparse/Ifc2x3enum.h"
|
#include "../ifcparse/Ifc2x3enum.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4100)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IfcSchema Ifc2x3
|
#define IfcSchema Ifc2x3
|
||||||
|
|
||||||
namespace Ifc2x3 {
|
namespace Ifc2x3 {
|
||||||
@@ -41583,4 +41587,8 @@ void InitStringMap();
|
|||||||
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4944,7 +4944,7 @@ std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::str
|
|||||||
if (inverse_map.empty()) ::InitInverseMap();
|
if (inverse_map.empty()) ::InitInverseMap();
|
||||||
inverse_map_t::const_iterator it;
|
inverse_map_t::const_iterator it;
|
||||||
inverse_map_t::mapped_type::const_iterator jt;
|
inverse_map_t::mapped_type::const_iterator jt;
|
||||||
while (true) {
|
for(;;) {
|
||||||
it = inverse_map.find(t);
|
it = inverse_map.find(t);
|
||||||
if (it != inverse_map.end()) {
|
if (it != inverse_map.end()) {
|
||||||
jt = it->second.find(a);
|
jt = it->second.find(a);
|
||||||
@@ -4964,7 +4964,7 @@ std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
|
|||||||
|
|
||||||
std::set<std::string> return_value;
|
std::set<std::string> return_value;
|
||||||
|
|
||||||
while (true) {
|
for (;;) {
|
||||||
it = inverse_map.find(t);
|
it = inverse_map.find(t);
|
||||||
if (it != inverse_map.end()) {
|
if (it != inverse_map.end()) {
|
||||||
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
|
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#include "../ifcparse/IfcWrite.h"
|
#include "../ifcparse/IfcWrite.h"
|
||||||
#include "../ifcparse/IfcWritableEntity.h"
|
#include "../ifcparse/IfcWritableEntity.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
using namespace Ifc4;
|
using namespace Ifc4;
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
|
|||||||
+9
-1
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
@@ -37,6 +36,11 @@
|
|||||||
#include "../ifcparse/IfcException.h"
|
#include "../ifcparse/IfcException.h"
|
||||||
#include "../ifcparse/Ifc4enum.h"
|
#include "../ifcparse/Ifc4enum.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4100)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IfcSchema Ifc4
|
#define IfcSchema Ifc4
|
||||||
|
|
||||||
namespace Ifc4 {
|
namespace Ifc4 {
|
||||||
@@ -55147,4 +55151,8 @@ void InitStringMap();
|
|||||||
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user