| 272 | #ifdef IFOPSH_WITH_ROCKSDB |
| 273 | |
| 274 | bool 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 | |
| 287 | bool impl::serialize(std::string& val, const EnumerationReference& v) |
| 288 | { |