mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Work towards v1.0 data model with encapsulated weak_ptr as basis for instances
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "express.h"
|
||||
#include "InstanceData.h"
|
||||
|
||||
const IfcParse::declaration& express::Base::declaration() const {
|
||||
return *data()->declaration();
|
||||
}
|
||||
uint32_t express::Base::identity() const { return data()->identity(); }
|
||||
|
||||
uint32_t express::Base::id() const { return data()->id(); }
|
||||
|
||||
const InstanceData* express::Base::data() const {
|
||||
auto sp = data_.lock();
|
||||
if (sp) {
|
||||
return sp.get();
|
||||
} else {
|
||||
throw std::runtime_error("Trying to access deleted instance reference");
|
||||
}
|
||||
}
|
||||
|
||||
InstanceData* express::Base::data() {
|
||||
auto sp = data_.lock();
|
||||
if (sp) {
|
||||
return sp.get();
|
||||
} else {
|
||||
throw std::runtime_error("Trying to access deleted instance reference");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user