| 67 | } |
| 68 | |
| 69 | IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcFile* file) |
| 70 | : file_(file), |
| 71 | file_description_(nullptr), |
| 72 | file_name_(nullptr), |
| 73 | file_schema_(nullptr) |
| 74 | { |
| 75 | Header_section_schema::get_schema(); |
| 76 | |
| 77 | if (file == nullptr) { |
| 78 | // overwritten later in IfcFile::setDefaultHeaderValues() when we know the schema identifier |
| 79 | file_description_ = new Header_section_schema::file_description({}, ""); |
| 80 | file_description_->file_ = file_; |
| 81 | file_name_ = new Header_section_schema::file_name("", "", {}, {}, "", "", ""); |
| 82 | file_name_->file_ = file_; |
| 83 | file_schema_ = new Header_section_schema::file_schema({}); |
| 84 | file_schema_->file_ = file_; |
| 85 | } else { |
| 86 | storage_ = std::visit([this](auto& m) -> decltype(storage_) { |
| 87 | if constexpr (std::is_same_v<std::decay_t<decltype(m)>, impl::in_memory_file_storage>) { |
| 88 | return &m; |
| 89 | } |
| 90 | return nullptr; |
| 91 | }, file_->storage_); |
| 92 | |
| 93 | if (storage_ == nullptr) { |
| 94 | file_description_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_description::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as<Header_section_schema::file_description>(); |
| 95 | file_description_->file_ = file_; |
| 96 | file_name_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_name::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as<Header_section_schema::file_name>(); |
| 97 | file_name_->file_ = file_; |
| 98 | file_schema_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_schema::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as<Header_section_schema::file_schema>(); |
| 99 | file_schema_->file_ = file_; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcSpfLexer* lexer) |
| 105 | { |
nothing calls this directly
no test coverage detected