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

Method begin_array_internal

src/mcpack2pb/serializer.cpp:716–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void Serializer::begin_array_internal(FieldType item_type, bool compack) {
717 if (!_stream->good()) {
718 return;
719 }
720 if (!array_add_item(_stream, peek_group_info(), FIELD_ARRAY, 1)) {
721 return _stream->set_bad();
722 }
723 GroupInfo* info = push_group_info();
724 if (info == NULL) {
725 CHECK(false) << "Fail to push array";
726 return _stream->set_bad();
727 }
728 info->item_count = 0;
729 info->item_type = item_type;
730 info->type = FIELD_ARRAY;
731 info->name_size = 0;
732 info->output_offset = _stream->pushed_bytes();
733 info->pending_null_count = 0;
734 info->head_area = _stream->reserve(sizeof(FieldLongHead));
735 if (compack && get_primitive_type_size(item_type)) {
736 info->isomorphic = true;
737 info->items_head_area = INVALID_AREA;
738 _stream->push_back((char)item_type);
739 } else {
740 info->isomorphic = false;
741 info->items_head_area = _stream->reserve(sizeof(ItemsHead));
742 }
743}
744
745void Serializer::begin_array_internal(const StringWrapper& name,
746 FieldType item_type,

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected