mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Fixes for compilation on clang
This commit is contained in:
@@ -99,9 +99,9 @@ protected:
|
||||
public:
|
||||
IfcBaseClass(IfcEntityInstanceData&& data)
|
||||
: identity_(counter_++)
|
||||
, data_(std::move(data))
|
||||
, id_(0)
|
||||
, file_(nullptr)
|
||||
, data_(std::move(data))
|
||||
{}
|
||||
|
||||
const IfcEntityInstanceData& data() const { return data_; }
|
||||
@@ -191,6 +191,34 @@ T IfcBaseEntity::get_value(const std::string& name, const T& default_value) cons
|
||||
}
|
||||
return (T) attr;
|
||||
}
|
||||
|
||||
} // namespace IfcUtil
|
||||
|
||||
template <class U>
|
||||
typename U::list::ptr aggregate_of_instance::as() {
|
||||
typename U::list::ptr result(new typename U::list);
|
||||
for (it i = begin(); i != end(); ++i) {
|
||||
if ((*i)->template as<U>()) {
|
||||
result->push((*i)->template as<U>());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class U>
|
||||
typename aggregate_of_aggregate_of<U>::ptr aggregate_of_aggregate_of_instance::as() {
|
||||
typename aggregate_of_aggregate_of<U>::ptr result(new aggregate_of_aggregate_of<U>);
|
||||
for (outer_it outer = begin(); outer != end(); ++outer) {
|
||||
const std::vector<IfcUtil::IfcBaseClass*>& from = *outer;
|
||||
typename std::vector<U*> to;
|
||||
for (inner_it inner = from.begin(); inner != from.end(); ++inner) {
|
||||
if ((*inner)->template as<U>()) {
|
||||
to.push_back((*inner)->template as<U>());
|
||||
}
|
||||
}
|
||||
result->push(to);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1422,7 +1422,7 @@ void IfcFile::initialize_(IfcParse::IfcSpfStream* s) {
|
||||
}
|
||||
byid_[p.first.name_]->data().storage_.set(p.first.index_, instances);
|
||||
} else {
|
||||
static_assert(false, "Inconsistent type");
|
||||
// static_assert(false, "Inconsistent type");
|
||||
}
|
||||
}, p.second);
|
||||
}
|
||||
|
||||
@@ -52,15 +52,7 @@ class IFC_PARSE_API aggregate_of_instance {
|
||||
bool contains(IfcUtil::IfcBaseClass*) const;
|
||||
|
||||
template <class U>
|
||||
typename U::list::ptr as() {
|
||||
typename U::list::ptr result(new typename U::list);
|
||||
for (it i = begin(); i != end(); ++i) {
|
||||
if ((*i)->template as<U>()) {
|
||||
result->push((*i)->template as<U>());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
typename U::list::ptr as();
|
||||
|
||||
void remove(IfcUtil::IfcBaseClass*);
|
||||
aggregate_of_instance::ptr filtered(const std::set<const IfcParse::declaration*>& entities);
|
||||
@@ -158,20 +150,7 @@ class IFC_PARSE_API aggregate_of_aggregate_of_instance {
|
||||
}
|
||||
|
||||
template <class U>
|
||||
typename aggregate_of_aggregate_of<U>::ptr as() {
|
||||
typename aggregate_of_aggregate_of<U>::ptr result(new aggregate_of_aggregate_of<U>);
|
||||
for (outer_it outer = begin(); outer != end(); ++outer) {
|
||||
const std::vector<IfcUtil::IfcBaseClass*>& from = *outer;
|
||||
typename std::vector<U*> to;
|
||||
for (inner_it inner = from.begin(); inner != from.end(); ++inner) {
|
||||
if ((*inner)->template as<U>()) {
|
||||
to.push_back((*inner)->template as<U>());
|
||||
}
|
||||
}
|
||||
result->push(to);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
typename aggregate_of_aggregate_of<U>::ptr as();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ static void process_characters(void* user, const xmlChar* character, int len) {
|
||||
auto val = parse_attribute_value(pt, txt);
|
||||
if (!val.empty()) {
|
||||
visit_any([&state](auto& v) {
|
||||
state->stack.back().inst()->data().setArgument(state->stack.back().idx(), v);
|
||||
state->stack.back().inst()->set_attribute_value(state->stack.back().idx(), v);
|
||||
}, val);
|
||||
}
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static void start_element(void* user, const xmlChar* tag, const xmlChar** attrs)
|
||||
auto val = parse_attribute_value(attr->type_of_attribute(), pair.second);
|
||||
if (!val.empty()) {
|
||||
visit_any([&untyped, idx](auto& v) {
|
||||
untyped->data().storage_->set_attribute_value(idx, v);
|
||||
untyped.storage_.set(idx, v);
|
||||
}, val);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user