mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Proceed with merge
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -127,6 +127,21 @@ namespace IfcUtil {
|
||||
virtual const IfcParse::entity& declaration() const = 0;
|
||||
|
||||
Argument* get(const std::string& name) const;
|
||||
|
||||
template <typename T>
|
||||
T get_value(const std::string& name) const {
|
||||
auto attr = get(name);
|
||||
return (T)*attr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
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;
|
||||
}
|
||||
|
||||
boost::shared_ptr<aggregate_of_instance> get_inverse(const std::string& a) const;
|
||||
};
|
||||
|
||||
@@ -20,15 +20,17 @@
|
||||
#ifndef IFCOPENSHELL_MACROS_H
|
||||
#define IFCOPENSHELL_MACROS_H
|
||||
|
||||
#define MAKE_TYPE_NAME__(a, b) a ## b
|
||||
#define MAKE_TYPE_NAME_(a, b) MAKE_TYPE_NAME__(a, b)
|
||||
#define MAKE_TYPE_NAME(t) MAKE_TYPE_NAME_(t, IfcSchema)
|
||||
#define POSTFIX_SCHEMA__(a, b) a ## _ ## b
|
||||
#define POSTFIX_SCHEMA_(a, b) POSTFIX_SCHEMA__(a, b)
|
||||
#define POSTFIX_SCHEMA(t) POSTFIX_SCHEMA_(t, IfcSchema)
|
||||
|
||||
#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)
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user