PHP Class Protobuf\Binary\SizeCalculator

Author: Fabio B. Silva ([email protected])
Show file Open project: protobuf-php/protobuf Class Usage Examples

Protected Properties

Property Type Description
$config Protobuf\Configuration

Public Methods

Method Description
__construct ( Configuration $config ) Constructor
computeBoolSize ( ) : integer Compute the number of bytes that would be needed to encode a bool.
computeByteStreamSize ( Stream $value ) : integer Compute the number of bytes that would be needed to encode a stream of bytes.
computeDoubleSize ( ) : integer Compute the number of bytes that would be needed to encode a double.
computeFixed32Size ( ) : integer Compute the number of bytes that would be needed to encode a fixed32.
computeFixed64Size ( ) : integer Compute the number of bytes that would be needed to encode a fixed64.
computeFloatSize ( ) : integer Compute the number of bytes that would be needed to encode a float.
computeSFixed32Size ( ) : integer Compute the number of bytes that would be needed to encode a sFixed32.
computeSFixed64Size ( ) : integer Compute the number of bytes that would be needed to encode a sFixed64.
computeStringSize ( integer $value ) : integer Compute the number of bytes that would be needed to encode a string.
computeVarintSize ( integer $value ) : integer Compute the number of bytes that would be needed to encode a varint.
computeZigzag32Size ( integer $value ) : integer Compute the number of bytes that would be needed to encode a zigzag 32.
computeZigzag64Size ( integer $value ) : integer Compute the number of bytes that would be needed to encode a zigzag 64.

Method Details

__construct() public method

Constructor
public __construct ( Configuration $config )
$config Protobuf\Configuration

computeBoolSize() public method

Compute the number of bytes that would be needed to encode a bool.
public computeBoolSize ( ) : integer
return integer

computeByteStreamSize() public method

Compute the number of bytes that would be needed to encode a stream of bytes.
public computeByteStreamSize ( Stream $value ) : integer
$value Protobuf\Stream
return integer

computeDoubleSize() public method

Compute the number of bytes that would be needed to encode a double.
public computeDoubleSize ( ) : integer
return integer

computeFixed32Size() public method

Compute the number of bytes that would be needed to encode a fixed32.
public computeFixed32Size ( ) : integer
return integer

computeFixed64Size() public method

Compute the number of bytes that would be needed to encode a fixed64.
public computeFixed64Size ( ) : integer
return integer

computeFloatSize() public method

Compute the number of bytes that would be needed to encode a float.
public computeFloatSize ( ) : integer
return integer

computeSFixed32Size() public method

Compute the number of bytes that would be needed to encode a sFixed32.
public computeSFixed32Size ( ) : integer
return integer

computeSFixed64Size() public method

Compute the number of bytes that would be needed to encode a sFixed64.
public computeSFixed64Size ( ) : integer
return integer

computeStringSize() public method

Compute the number of bytes that would be needed to encode a string.
public computeStringSize ( integer $value ) : integer
$value integer
return integer

computeVarintSize() public method

Compute the number of bytes that would be needed to encode a varint.
public computeVarintSize ( integer $value ) : integer
$value integer
return integer

computeZigzag32Size() public method

Compute the number of bytes that would be needed to encode a zigzag 32.
public computeZigzag32Size ( integer $value ) : integer
$value integer
return integer

computeZigzag64Size() public method

Compute the number of bytes that would be needed to encode a zigzag 64.
public computeZigzag64Size ( integer $value ) : integer
$value integer
return integer

Property Details

$config protected property

protected Configuration,Protobuf $config
return Protobuf\Configuration