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

Method has

src/ifcparse/IfcEntityInstanceData.cpp:480–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478
479template<typename T>
480bool rocks_db_attribute_storage::has(void* storage, const IfcParse::declaration* decl, std::size_t identity, std::size_t index) const
481{
482 // @todo unify with other implementation functions
483 const bool is_header = decl->schema() == &Header_section_schema::get_schema();
484 IfcParse::impl::rocks_db_file_storage* rdb_storage = (IfcParse::impl::rocks_db_file_storage*)storage;
485 std::string v;
486 auto success = rdb_storage->db->Get(
487 rocksdb::ReadOptions{},
488 (is_header ? "h|" : (decl->as_entity() ? "i|" : "t|")) +
489 (is_header ? decl->name() : std::to_string(identity)) + "|" +
490 std::to_string(index), &v);
491 if constexpr (std::is_same_v<std::decay_t<T>, Blank>) {
492 if (!success.ok()) {
493 return true;
494 }
495 }
496 return v.size() && v[0] == TypeEncoder::encode_type<T>();
497}
498
499template<typename T>
500void rocks_db_attribute_storage::set(void* storage, const IfcParse::declaration* decl, std::size_t identity, std::size_t index, const T& value)

Callers 3

writeHeaderMethod · 0.45
ttl_object_idMethod · 0.45
IfcConvert.cppFile · 0.45

Calls 6

get_schemaFunction · 0.85
to_stringFunction · 0.85
GetMethod · 0.80
schemaMethod · 0.45
nameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected