| 399 | } |
| 400 | |
| 401 | void WriteContext::reset() { |
| 402 | // Clear error state first |
| 403 | error_ = Error(); |
| 404 | if (config_->track_ref) { |
| 405 | ref_writer_.reset(); |
| 406 | } |
| 407 | // Clear meta map for streaming TypeMeta (size is used as counter) |
| 408 | if (type_info_index_map_active_) { |
| 409 | write_type_info_index_map_.clear(); |
| 410 | } |
| 411 | first_type_info_ = nullptr; |
| 412 | has_first_type_info_ = false; |
| 413 | type_info_index_map_active_ = false; |
| 414 | current_dyn_depth_ = 0; |
| 415 | buffer_.clear_output_stream(); |
| 416 | output_stream_ = nullptr; |
| 417 | // reset buffer indices for reuse - no memory operations needed |
| 418 | buffer_.writer_index(0); |
| 419 | buffer_.reader_index(0); |
| 420 | } |
| 421 | |
| 422 | uint32_t WriteContext::get_type_id_for_cache(const std::type_index &type_idx) { |
| 423 | auto result = type_resolver_->get_type_info(type_idx); |
nothing calls this directly
no test coverage detected