More work

This commit is contained in:
Thomas Krijnen
2019-08-16 17:40:13 +02:00
parent dae35f59ce
commit ddeaf5a375
52 changed files with 4083 additions and 4184 deletions
+15
View File
@@ -78,6 +78,21 @@ namespace IfcUtil {
virtual const IfcParse::entity& declaration() const = 0;
Argument* get(const std::string& name) const;
template <typename T>
T get_value_or(const std::string& name, const T& if_null) const {
auto arg = get(name);
if (arg->isNull()) {
return if_null;
} else {
return *arg;
}
}
template <typename T>
T get_value(const std::string& name) const {
return *get(name);
}
};
// TODO: Investigate whether these should be template classes instead
+1 -1
View File
@@ -27,7 +27,7 @@
#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)
#define MAKE_INIT_FN__(a, b) init_ ## a ## b
#define MAKE_INIT_FN__(a, b) init_ ## a ## _ ## b
#define MAKE_INIT_FN_(a, b) MAKE_INIT_FN__(a, b)
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)