• Модуль: pull
  • Путь к файлу: ~/bitrix/modules/pull/lib/protobuf/responsebatch.php
  • Класс: BitrixPullProtobufResponseBatch
  • Вызов: ResponseBatch::serializedSize
public function serializedSize(ProtobufComputeSizeContext $context)
    {
        $calculator = $context->getSizeCalculator();
        $size       = 0;

        if ($this->responses !== null) {
            foreach ($this->responses as $val) {
                $innerSize = $val->serializedSize($context);

                $size += 1;
                $size += $innerSize;
                $size += $calculator->computeVarintSize($innerSize);
            }
        }

        if ($this->extensions !== null) {
            $size += $this->extensions->serializedSize($context);
        }

        return $size;
    }