Sprinkle with template and typename keywords

This commit is contained in:
Thomas Krijnen
2017-12-22 16:45:02 +01:00
parent 472fde5599
commit 5e23086947
8 changed files with 20 additions and 12 deletions
+3 -1
View File
@@ -40,7 +40,7 @@ struct %(schema_name)s {
static const IfcParse::schema_definition& get_schema();
static const char* const Identifier = "%(schema_name_upper)s";
static const char* const Identifier;
// Forward definitions
%(forward_definitions)s
@@ -75,6 +75,8 @@ implementation= """
#include <map>
const char* const %(schema_name)s::Identifier = "%(schema_name_upper)s";
using namespace IfcParse;
using namespace IfcWrite;
+2
View File
@@ -31,6 +31,8 @@
#include <map>
const char* const Ifc2x3::Identifier = "IFC2X3";
using namespace IfcParse;
using namespace IfcWrite;
File diff suppressed because one or more lines are too long
+2
View File
@@ -31,6 +31,8 @@
#include <map>
const char* const Ifc4::Identifier = "IFC4";
using namespace IfcParse;
using namespace IfcWrite;
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -187,12 +187,12 @@ class IFC_PARSE_API IfcFileWithSchema : public IfcFile {
public:
std::pair<typename Schema::IfcNamedUnit*, double> getUnit(typename Schema::IfcUnitEnum::Value unit_type) {
std::pair<IfcUtil::IfcBaseClass*, double> unit_info = IfcFile::getUnit(Schema::IfcUnitEnum::ToString(unit_type));
return std::make_pair(unit_info.first->as<typename Schema::IfcNamedUnit>(), unit_info.second);
return std::make_pair(unit_info.first->template as<typename Schema::IfcNamedUnit>(), unit_info.second);
}
/// Returns the entity with the specified GlobalId
virtual typename Schema::IfcRoot::list::ptr instance_by_guid(const std::string& guid) {
return IfcFile::instance_by_guid(guid)->as<typename Schema::IfcRoot>();
virtual typename Schema::IfcRoot* instance_by_guid(const std::string& guid) {
return IfcFile::instance_by_guid(guid)->template as<typename Schema::IfcRoot>();
}
};
+3 -3
View File
@@ -48,16 +48,16 @@ double IfcParse::get_SI_equivalent(typename Schema::IfcNamedUnit* named_unit) {
typename Schema::IfcSIUnit* si_unit = 0;
if (named_unit->declaration().is(Schema::IfcConversionBasedUnit::Class())) {
typename Schema::IfcConversionBasedUnit* conv_unit = named_unit->as<typename Schema::IfcConversionBasedUnit>();
typename Schema::IfcConversionBasedUnit* conv_unit = named_unit->template as<typename Schema::IfcConversionBasedUnit>();
typename Schema::IfcMeasureWithUnit* factor = conv_unit->ConversionFactor();
typename Schema::IfcUnit* component = factor->UnitComponent();
if (component->declaration().is(Schema::IfcSIUnit::Class())) {
si_unit = component->as<typename Schema::IfcSIUnit>();
si_unit = component->template as<typename Schema::IfcSIUnit>();
typename Schema::IfcValue* v = factor->ValueComponent();
scale = *v->data().getArgument(0);
}
} else if (named_unit->declaration().is(Schema::IfcSIUnit::Class())) {
si_unit = named_unit->as<typename Schema::IfcSIUnit>();
si_unit = named_unit->template as<typename Schema::IfcSIUnit>();
}
if (si_unit) {
if (si_unit->hasPrefix()) {
+5 -3
View File
@@ -135,6 +135,8 @@ namespace IfcParse {
, schema_(0)
{}
virtual ~declaration() {}
const std::string& name() const { return name_; }
const std::string& name_lc() const { return name_lower_; }
@@ -232,7 +234,7 @@ namespace IfcParse {
{}
const std::string& name() const { return name_; }
aggregate_type type_of_aggregation() const { type_of_aggregation_; }
aggregate_type type_of_aggregation() const { return type_of_aggregation_; }
int bound1() const { return bound1_; }
int bound2() const { return bound2_; }
const entity* entity_reference() const { return entity_reference_; }
@@ -358,7 +360,7 @@ namespace IfcParse {
index = std::distance(current->attributes().begin(), it);
}
}
} while ((current = current->supertype_));
} while ((current = current->supertype_) != 0);
return index;
}
@@ -376,7 +378,7 @@ namespace IfcParse {
index = std::distance(current->attributes().begin(), it);
}
}
} while ((current = current->supertype_));
} while ((current = current->supertype_) != 0);
return index;
}