MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / initialize

Method initialize

src/ifcparse/IfcParse.cpp:1189–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1187}
1188
1189bool IfcParse::IfcFile::initialize(const std::string& fn, bool mmap) {
1190 std::unique_ptr<FileReader> s;
1191 if (mmap) {
1192 s = std::make_unique<FileReader>(fn, FileReader::mmap_tag{});
1193 } else {
1194 s = std::make_unique<FileReader>(fn);
1195 }
1196
1197 storage_.emplace<1>(this);
1198 std::get<impl::in_memory_file_storage>(storage_).read_from_stream(&*s, schema_, max_id_, types_to_bypass_loading_);
1199
1200 if ((good_ = std::get<impl::in_memory_file_storage>(storage_).good_)) {
1201 // @todo unify these names, it's already confusing enough as it stands
1202 byid_ = decltype(byid_)(&std::get<impl::in_memory_file_storage>(storage_).byid_);
1203 byref_excl_ = decltype(byref_excl_)(&std::get<impl::in_memory_file_storage>(storage_).byref_excl_);
1204 byguid_ = decltype(byguid_)(&std::get<impl::in_memory_file_storage>(storage_).byguid_);
1205 }
1206
1207 ifcroot_type_ = schema_ ? schema_->declaration_by_name("IfcRoot") : nullptr;
1208 return good_ == file_open_status::SUCCESS;
1209}
1210#endif
1211
1212IfcFile::IfcFile(const uninitialized_tag&)

Callers 2

create_geometryMethod · 0.45
patchMethod · 0.45

Calls 2

read_from_streamMethod · 0.80
read_schemaMethod · 0.80

Tested by

no test coverage detected