本文整理汇总了PHP中google\protobuf\FieldDescriptorProto\Label::value方法的典型用法代码示例。如果您正苦于以下问题:PHP Label::value方法的具体用法?PHP Label::value怎么用?PHP Label::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类google\protobuf\FieldDescriptorProto\Label
的用法示例。
在下文中一共展示了Label::value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serializedSize
/**
* {@inheritdoc}
*/
public function serializedSize(\Protobuf\ComputeSizeContext $context)
{
$calculator = $context->getSizeCalculator();
$size = 0;
if ($this->name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->name);
}
if ($this->number !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->number);
}
if ($this->label !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->label->value());
}
if ($this->type !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->type->value());
}
if ($this->type_name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->type_name);
}
if ($this->extendee !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->extendee);
}
if ($this->default_value !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->default_value);
}
if ($this->oneof_index !== null) {
$size += 1;
$size += $calculator->computeVarintSize($this->oneof_index);
}
if ($this->json_name !== null) {
$size += 1;
$size += $calculator->computeStringSize($this->json_name);
}
if ($this->options !== null) {
$innerSize = $this->options->serializedSize($context);
$size += 1;
$size += $innerSize;
$size += $calculator->computeVarintSize($innerSize);
}
if ($this->extensions !== null) {
$size += $this->extensions->serializedSize($context);
}
return $size;
}