2026-01-04 10:40:02 +01:00
|
|
|
#include "express.h"
|
2026-03-31 15:32:36 +02:00
|
|
|
#include "instance_data.h"
|
2026-01-04 10:40:02 +01:00
|
|
|
|
2026-03-31 15:32:36 +02:00
|
|
|
const ifcopenshell::declaration& express::Base::declaration() const {
|
2026-01-04 10:40:02 +01:00
|
|
|
return *data()->declaration();
|
|
|
|
|
}
|
|
|
|
|
uint32_t express::Base::identity() const { return data()->identity(); }
|
|
|
|
|
|
|
|
|
|
uint32_t express::Base::id() const { return data()->id(); }
|
|
|
|
|
|
2026-03-31 15:32:36 +02:00
|
|
|
const instance_data* express::Base::data() const {
|
2026-06-11 15:51:40 +02:00
|
|
|
#ifdef IFOPSH_SAFE_INSTANCE
|
2026-01-04 10:40:02 +01:00
|
|
|
auto sp = data_.lock();
|
|
|
|
|
if (sp) {
|
|
|
|
|
return sp.get();
|
|
|
|
|
} else {
|
|
|
|
|
throw std::runtime_error("Trying to access deleted instance reference");
|
|
|
|
|
}
|
2026-06-11 15:51:40 +02:00
|
|
|
#else
|
|
|
|
|
return data_;
|
|
|
|
|
#endif
|
2026-01-04 10:40:02 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 15:32:36 +02:00
|
|
|
instance_data* express::Base::data() {
|
2026-06-11 15:51:40 +02:00
|
|
|
#ifdef IFOPSH_SAFE_INSTANCE
|
2026-01-04 10:40:02 +01:00
|
|
|
auto sp = data_.lock();
|
|
|
|
|
if (sp) {
|
|
|
|
|
return sp.get();
|
|
|
|
|
} else {
|
|
|
|
|
throw std::runtime_error("Trying to access deleted instance reference");
|
|
|
|
|
}
|
2026-06-11 15:51:40 +02:00
|
|
|
#else
|
|
|
|
|
return data_;
|
|
|
|
|
#endif
|
2026-01-04 10:40:02 +01:00
|
|
|
}
|