From 99abc6e0e2cfa2ecd195fb32242af85eabc75cc4 Mon Sep 17 00:00:00 2001 From: aothms Date: Fri, 31 Mar 2023 15:19:39 -0400 Subject: [PATCH] Fix errors on clang --- src/ifcgeom/taxonomy.h | 1 - src/ifcparse/Argument.h | 23 +++-------------------- src/ifcparse/IfcBaseClass.h | 32 +++++++++++++++++++++----------- src/ifcparse/IfcParse.h | 1 + 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/ifcgeom/taxonomy.h b/src/ifcgeom/taxonomy.h index f20313296d..62e0e011ac 100644 --- a/src/ifcgeom/taxonomy.h +++ b/src/ifcgeom/taxonomy.h @@ -11,7 +11,6 @@ #include #include #include -#include // @todo don't do std::less but use hashing and cache hash values. diff --git a/src/ifcparse/Argument.h b/src/ifcparse/Argument.h index b4935c58bc..e67a5b9bd3 100644 --- a/src/ifcparse/Argument.h +++ b/src/ifcparse/Argument.h @@ -27,32 +27,15 @@ #include #include "ifc_parse_api.h" - -#include "../ifcparse/aggregate_of_instance.h" +#include "ArgumentType.h" #include #include #include -/* -namespace boost { - namespace logic { - class tribool { - - }; - } -} -*/ - -class Argument; - class aggregate_of_instance; class aggregate_of_aggregate_of_instance; -class IfcEntityInstanceData; -namespace IfcParse { - class IfcFile; -} namespace IfcUtil { class IfcBaseClass; @@ -76,11 +59,11 @@ public: virtual operator std::vector() const; virtual operator std::vector() const; virtual operator std::vector >() const; - virtual operator aggregate_of_instance::ptr() const; + virtual operator boost::shared_ptr() const; virtual operator std::vector< std::vector >() const; virtual operator std::vector< std::vector >() const; - virtual operator aggregate_of_aggregate_of_instance::ptr() const; + virtual operator boost::shared_ptr() const; virtual bool isNull() const = 0; virtual unsigned int size() const = 0; diff --git a/src/ifcparse/IfcBaseClass.h b/src/ifcparse/IfcBaseClass.h index 42ef24c2b8..34d8c11bfa 100644 --- a/src/ifcparse/IfcBaseClass.h +++ b/src/ifcparse/IfcBaseClass.h @@ -129,19 +129,10 @@ namespace IfcUtil { Argument* get(const std::string& name) const; template - T get_value(const std::string& name) const { - auto attr = get(name); - return (T)*attr; - } + T get_value(const std::string& name) const; template - T get_value(const std::string& name, const T& default_value) const { - auto attr = get(name); - if (attr->isNull()) { - return default_value; - } - return (T)*attr; - } + T get_value(const std::string& name, const T& default_value) const; boost::shared_ptr get_inverse(const std::string& a) const; }; @@ -157,4 +148,23 @@ namespace IfcUtil { } +#include "../ifcparse/Argument.h" + +namespace IfcUtil { + template + T IfcBaseEntity::get_value(const std::string& name) const { + auto attr = get(name); + return (T)*attr; + } + + template + T IfcBaseEntity::get_value(const std::string& name, const T& default_value) const { + auto attr = get(name); + if (attr->isNull()) { + return default_value; + } + return (T)*attr; + } +} + #endif diff --git a/src/ifcparse/IfcParse.h b/src/ifcparse/IfcParse.h index 484345128f..ce774678e2 100644 --- a/src/ifcparse/IfcParse.h +++ b/src/ifcparse/IfcParse.h @@ -52,6 +52,7 @@ #include "../ifcparse/IfcBaseClass.h" #include "../ifcparse/IfcLogger.h" #include "../ifcparse/Argument.h" +#include "../ifcparse/aggregate_of_instance.h" #include "../ifcparse/IfcSpfStream.h"