mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
Re-enable explicit tagging and validation of derived in subtype
This commit is contained in:
@@ -67,6 +67,9 @@ namespace {
|
|||||||
fn(IfcParse::TokenFunc::asInt(t));
|
fn(IfcParse::TokenFunc::asInt(t));
|
||||||
} else if (t.type == IfcParse::Token_STRING) {
|
} else if (t.type == IfcParse::Token_STRING) {
|
||||||
fn(IfcParse::TokenFunc::asStringRef(t));
|
fn(IfcParse::TokenFunc::asStringRef(t));
|
||||||
|
} else if (t.type == IfcParse::Token_OPERATOR && t.value_char == '*') {
|
||||||
|
// This is only in place for the validator
|
||||||
|
fn(Derived{});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -763,8 +763,15 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
|||||||
} else if constexpr (is_std_vector_v<U>) {
|
} else if constexpr (is_std_vector_v<U>) {
|
||||||
return pythonize_vector(v);
|
return pythonize_vector(v);
|
||||||
} else if constexpr (std::is_same_v<U, EnumerationReference>) {
|
} else if constexpr (std::is_same_v<U, EnumerationReference>) {
|
||||||
return pythonize(v.value());
|
return pythonize(std::string(v.value()));
|
||||||
} else if constexpr (std::is_same_v<U, empty_aggregate_t> || std::is_same_v<U, empty_aggregate_of_aggregate_t> || std::is_same_v<U, Derived> || std::is_same_v<U, Blank>) {
|
} else if constexpr (std::is_same_v<U, Derived>) {
|
||||||
|
if (feature_use_attribute_value_derived) {
|
||||||
|
return SWIG_NewPointerObj(new attribute_value_derived, SWIGTYPE_p_attribute_value_derived, SWIG_POINTER_OWN);
|
||||||
|
} else {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return static_cast<PyObject*>(Py_None);
|
||||||
|
}
|
||||||
|
} else if constexpr (std::is_same_v<U, empty_aggregate_t> || std::is_same_v<U, empty_aggregate_of_aggregate_t> || std::is_same_v<U, Blank>) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return static_cast<PyObject*>(Py_None);
|
return static_cast<PyObject*>(Py_None);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -43,7 +43,17 @@
|
|||||||
} else if constexpr (is_std_vector_v<U>) {
|
} else if constexpr (is_std_vector_v<U>) {
|
||||||
return pythonize_vector(v);
|
return pythonize_vector(v);
|
||||||
} else if constexpr (std::is_same_v<U, EnumerationReference>) {
|
} else if constexpr (std::is_same_v<U, EnumerationReference>) {
|
||||||
return pythonize(v.value());
|
return pythonize(std::string(v.value()));
|
||||||
|
} else if constexpr (std::is_same_v<U, Derived>) {
|
||||||
|
if (feature_use_attribute_value_derived) {
|
||||||
|
return SWIG_NewPointerObj(new attribute_value_derived, SWIGTYPE_p_attribute_value_derived, SWIG_POINTER_OWN);
|
||||||
|
} else {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return static_cast<PyObject*>(Py_None);
|
||||||
|
}
|
||||||
|
} else if constexpr (std::is_same_v<U, empty_aggregate_t> || std::is_same_v<U, empty_aggregate_of_aggregate_t> || std::is_same_v<U, Blank>) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return static_cast<PyObject*>(Py_None);
|
||||||
} else if constexpr (std::is_same_v<U, empty_aggregate_t> || std::is_same_v<U, empty_aggregate_of_aggregate_t> || std::is_same_v<U, Derived> || std::is_same_v<U, Blank>) {
|
} else if constexpr (std::is_same_v<U, empty_aggregate_t> || std::is_same_v<U, empty_aggregate_of_aggregate_t> || std::is_same_v<U, Derived> || std::is_same_v<U, Blank>) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return static_cast<PyObject*>(Py_None);
|
return static_cast<PyObject*>(Py_None);
|
||||||
|
|||||||
Reference in New Issue
Block a user