mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Exploration of using rocksdb as file+instance storage
This commit is contained in:
@@ -434,17 +434,17 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
|
||||
aggregate_of_instance::ptr related_objects(new aggregate_of_instance);
|
||||
related_objects->push(related_object);
|
||||
|
||||
IfcEntityInstanceData data = IfcEntityInstanceData(storage_t(T::Class().attribute_count()));
|
||||
data.storage_.set(0, (std::string)IfcParse::IfcGlobalId());
|
||||
data.storage_.set(1, owner_hist);
|
||||
IfcEntityInstanceData data = IfcEntityInstanceData(in_memory_attribute_storage(T::Class().attribute_count()));
|
||||
data.set_attribute_value(0, (std::string)IfcParse::IfcGlobalId());
|
||||
data.set_attribute_value(1, owner_hist);
|
||||
int relating_index = 4;
|
||||
int related_index = 5;
|
||||
if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of<typename Schema::IfcRelDefines, T>::value) {
|
||||
// some classes have attributes reversed.
|
||||
std::swap(relating_index, related_index);
|
||||
}
|
||||
data.storage_.set(relating_index, relating_object);
|
||||
data.storage_.set(related_index, related_objects);
|
||||
data.set_attribute_value(relating_index, relating_object);
|
||||
data.set_attribute_value(related_index, related_objects);
|
||||
|
||||
T* t = (T*)Schema::get_schema().instantiate(&T::Class(), std::move(data));
|
||||
addEntity(t);
|
||||
|
||||
Reference in New Issue
Block a user