diff --git a/src/ifcparse/IfcEntityInstanceData.cpp b/src/ifcparse/IfcEntityInstanceData.cpp index ac340d67fb..50fdc253cf 100644 --- a/src/ifcparse/IfcEntityInstanceData.cpp +++ b/src/ifcparse/IfcEntityInstanceData.cpp @@ -529,8 +529,6 @@ template IFC_PARSE_API void rocks_db_attribute_storage::set(void* stora template IFC_PARSE_API void rocks_db_attribute_storage::set(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index, const empty_aggregate_t& value); template IFC_PARSE_API void rocks_db_attribute_storage::set(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index, const empty_aggregate_of_aggregate_t& value); - - template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index) const; template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index) const; template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index) const; @@ -554,4 +552,17 @@ template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* stora template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index) const; template IFC_PARSE_API bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, size_t index) const; +template +T* InstanceData::get_storage_of_type() const { + return std::visit([this](auto& m) -> T* { + if constexpr (std::is_same_v, T>) { + return &m; + } + return nullptr; + }, file()->storage_); +} + +template IFC_PARSE_API IfcParse::impl::in_memory_file_storage* InstanceData::get_storage_of_type() const; +template IFC_PARSE_API IfcParse::impl::rocks_db_file_storage* InstanceData::get_storage_of_type() const; + #endif \ No newline at end of file diff --git a/src/ifcparse/InstanceData.h b/src/ifcparse/InstanceData.h index 00e54b0f27..7d511cb10d 100644 --- a/src/ifcparse/InstanceData.h +++ b/src/ifcparse/InstanceData.h @@ -424,15 +424,7 @@ class IFC_PARSE_API InstanceData { uint32_t id_; template - T* get_storage_of_type() const { - return std::visit([this](auto& m) -> T* { - if constexpr (std::is_same_v, T>) { - return &m; - } - return nullptr; - }, - file()->storage_); - } + T* get_storage_of_type() const; public: // Since rocks_db_attribute_storage has no members this is not a variant but in_memory*, where nullptr means a rocks_db_attribute_storage is constructed on the fly given the context from instance data.