129 return \google\protobuf\DescriptorProto::fromArray([
130 'name' =>
'RequestBatch',
132 \google\protobuf\FieldDescriptorProto::fromArray([
134 'name' =>
'requests',
135 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),
136 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_REPEATED(),
137 'type_name' =>
'.Request'
161 public function writeTo(\Protobuf\WriteContext $context)
163 $stream = $context->getStream();
164 $writer = $context->getWriter();
165 $sizeContext = $context->getComputeSizeContext();
167 if ($this->requests !==
null) {
168 foreach ($this->requests as $val) {
169 $writer->writeVarint($stream, 10);
170 $writer->writeVarint($stream, $val->serializedSize($sizeContext));
171 $val->writeTo($context);
185 public function readFrom(\Protobuf\ReadContext $context)
187 $reader = $context->getReader();
188 $length = $context->getLength();
189 $stream = $context->getStream();
191 $limit = ($length !==
null)
192 ? ($stream->tell() + $length)
195 while ($limit ===
null || $stream->tell() < $limit) {
197 if ($stream->eof()) {
201 $key = $reader->readVarint($stream);
202 $wire = \Protobuf\WireFormat::getTagWireType($key);
203 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);
205 if ($stream->eof()) {
210 \Protobuf\WireFormat::assertWireType($wire, 11);
212 $innerSize = $reader->readVarint($stream);
213 $innerMessage = new \Bitrix\Pull\Protobuf\Request();
215 if ($this->requests ===
null) {
216 $this->requests = new \Protobuf\MessageCollection();
219 $this->requests->add($innerMessage);
221 $context->setLength($innerSize);
222 $innerMessage->readFrom($context);
223 $context->setLength($length);
231 if ($extension !==
null) {
232 $this->
extensions()->add($extension, $extension->readFrom($context, $wire));
241 $data = $reader->readUnknown($stream, $wire);
242 $unknown = new \Protobuf\Unknown($tag, $wire, $data);
254 $calculator = $context->getSizeCalculator();
257 if ($this->requests !==
null) {
258 foreach ($this->requests as $val) {
259 $innerSize = $val->serializedSize($context);
263 $size += $calculator->computeVarintSize($innerSize);
268 $size += $this->
extensions->serializedSize($context);