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

Function dispatch_index_

src/ifcparse/IfcEntityInstanceData.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 inline size_t dispatch_index_(AttributeValue::pointer_type array_, uint8_t storage_model_, size_t instance_name_, const IfcParse::declaration* entity_or_type, uint8_t index_)
91 {
92 if (storage_model_ == 0) {
93 return array_.storage_ptr->index(index_);
94 }
95#ifdef IFOPSH_WITH_ROCKSDB
96 else {
97 std::string str;
98 const bool is_header = entity_or_type->schema() == &Header_section_schema::get_schema();
99 if (!array_.db_ptr->db->Get(rocksdb::ReadOptions{},
100 (is_header ? "h|" : (entity_or_type->as_entity() ? "i|" : "t|")) +
101 (is_header ? entity_or_type->name() : std::to_string(instance_name_)) + "|" +
102 std::to_string(index_), &str).ok()) {
103 return TypeEncoder::encode_type<Blank>() - 'A';
104 }
105 return (size_t) str[0] - 'A';
106 }
107#endif
108 }
109}
110
111AttributeValue::operator int() const

Callers 1

typeMethod · 0.85

Calls 6

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

Tested by

no test coverage detected