Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
serverstatsrequest.php
1<?
2
4
15class ServerStatsRequest extends \Protobuf\AbstractMessage
16{
17
21 protected $unknownFieldSet = null;
22
26 protected $extensions = null;
27
31 public function extensions()
32 {
33 if ( $this->extensions !== null) {
34 return $this->extensions;
35 }
36
37 return $this->extensions = new \Protobuf\Extension\ExtensionFieldMap(__CLASS__);
38 }
39
43 public function unknownFieldSet()
44 {
46 }
47
51 public static function fromStream($stream, \Protobuf\Configuration $configuration = null)
52 {
53 return new self($stream, $configuration);
54 }
55
59 public static function fromArray(array $values)
60 {
61 $message = new self();
62 $values = array_merge([
63 ], $values);
64
65 return $message;
66 }
67
71 public static function descriptor()
72 {
73 return \google\protobuf\DescriptorProto::fromArray([
74 'name' => 'ServerStatsRequest',
75 ]);
76 }
77
81 public function toStream(\Protobuf\Configuration $configuration = null)
82 {
83 $config = $configuration ?: \Protobuf\Configuration::getInstance();
84 $context = $config->createWriteContext();
85 $stream = $context->getStream();
86
87 $this->writeTo($context);
88 $stream->seek(0);
89
90 return $stream;
91 }
92
96 public function writeTo(\Protobuf\WriteContext $context)
97 {
98 $stream = $context->getStream();
99 $writer = $context->getWriter();
100 $sizeContext = $context->getComputeSizeContext();
101
102 if ($this->extensions !== null) {
103 $this->extensions->writeTo($context);
104 }
105
106 return $stream;
107 }
108
112 public function readFrom(\Protobuf\ReadContext $context)
113 {
114 $reader = $context->getReader();
115 $length = $context->getLength();
116 $stream = $context->getStream();
117
118 $limit = ($length !== null)
119 ? ($stream->tell() + $length)
120 : null;
121
122 while ($limit === null || $stream->tell() < $limit) {
123
124 if ($stream->eof()) {
125 break;
126 }
127
128 $key = $reader->readVarint($stream);
129 $wire = \Protobuf\WireFormat::getTagWireType($key);
130 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);
131
132 if ($stream->eof()) {
133 break;
134 }
135
136 $extensions = $context->getExtensionRegistry();
137 $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null;
138
139 if ($extension !== null) {
140 $this->extensions()->add($extension, $extension->readFrom($context, $wire));
141
142 continue;
143 }
144
145 if ($this->unknownFieldSet === null) {
146 $this->unknownFieldSet = new \Protobuf\UnknownFieldSet();
147 }
148
149 $data = $reader->readUnknown($stream, $wire);
150 $unknown = new \Protobuf\Unknown($tag, $wire, $data);
151
152 $this->unknownFieldSet->add($unknown);
153
154 }
155 }
156
160 public function serializedSize(\Protobuf\ComputeSizeContext $context)
161 {
162 $calculator = $context->getSizeCalculator();
163 $size = 0;
164
165 if ($this->extensions !== null) {
166 $size += $this->extensions->serializedSize($context);
167 }
168
169 return $size;
170 }
171
175 public function clear()
176 {
177 }
178
182 public function merge(\Protobuf\Message $message)
183 {
184 if ( ! $message instanceof \Bitrix\Pull\Protobuf\ServerStatsRequest) {
185 throw new \InvalidArgumentException(sprintf('Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));
186 }
187 }
188
189
190}
191
writeTo(\Protobuf\WriteContext $context)
toStream(\Protobuf\Configuration $configuration=null)
serializedSize(\Protobuf\ComputeSizeContext $context)
static fromStream($stream, \Protobuf\Configuration $configuration=null)
readFrom(\Protobuf\ReadContext $context)