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

Method serialize

src/ifcparse/IfcEntityInstanceData.cpp:274–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272#ifdef IFOPSH_WITH_ROCKSDB
273
274bool impl::serialize(std::string& val, const IfcUtil::IfcBaseClass* t)
275{
276 auto s = sizeof(size_t);
277 val.resize(s + 2);
278 val[0] = TypeEncoder::encode_type<IfcUtil::IfcBaseClass*>();
279 // 1 = entity - stored by id (entity name)
280 // 2 = type - stored by identity (internal counter in class)
281 val[1] = t->declaration().as_entity() ? 'i' : 't';
282 size_t iden = t->id() ? t->id() : t->identity();
283 memcpy(val.data() + 2, &iden, s);
284 return true;
285}
286
287bool impl::serialize(std::string& val, const EnumerationReference& v)
288{

Callers

nothing calls this directly

Calls 12

to_stringFunction · 0.85
resizeMethod · 0.80
dataMethod · 0.80
indexMethod · 0.80
putMethod · 0.80
idMethod · 0.45
enumerationMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
writeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected