MCPcopy Create free account
hub / github.com/apache/brpc / begin_object_internal

Method begin_object_internal

src/mcpack2pb/serializer.cpp:627–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625// append array/object
626
627void Serializer::begin_object_internal() {
628 if (!_stream->good()) {
629 return;
630 }
631 if (!array_add_item(_stream, peek_group_info(), FIELD_OBJECT, 1)) {
632 return _stream->set_bad();
633 }
634 GroupInfo* info = push_group_info();
635 if (info == NULL) {
636 CHECK(false) << "Fail to push object";
637 return _stream->set_bad();
638 }
639 info->item_count = 0;
640 info->isomorphic = false;
641 info->item_type = 0;
642 info->type = FIELD_OBJECT;
643 info->name_size = 0;
644 info->output_offset = _stream->pushed_bytes();
645 info->pending_null_count = 0;
646 info->head_area = _stream->reserve(sizeof(ObjectHead));
647 info->items_head_area = INVALID_AREA;
648}
649
650void Serializer::begin_object_internal(const StringWrapper& name) {
651 if (name.empty()) {

Callers

nothing calls this directly

Calls 10

array_add_itemFunction · 0.85
object_add_itemFunction · 0.85
goodMethod · 0.45
set_badMethod · 0.45
pushed_bytesMethod · 0.45
reserveMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected