MCPcopy Create free account
hub / github.com/apache/fory / reset

Method reset

cpp/fory/serialization/context.cc:401–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void 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
422uint32_t WriteContext::get_type_id_for_cache(const std::type_index &type_idx) {
423 auto result = type_resolver_->get_type_info(type_idx);

Callers

nothing calls this directly

Calls 6

clear_output_streamMethod · 0.80
writer_indexMethod · 0.80
reader_indexMethod · 0.80
resetMethod · 0.65
ErrorClass · 0.50
clearMethod · 0.45

Tested by

no test coverage detected