MySQL 8.4.0
Source Code Documentation
mysql::serialization::Byte_count_helper< 0 > Struct Reference

Specialization of Byte_count_helper for 0 field_size. More...

#include <primitive_type_codec.h>

Static Public Member Functions

template<class Type , typename Enabler = std::enable_if_t< std::is_integral<std::decay_t<Type>>::value>>
static size_t count_write_bytes (const Type &arg)
 Calculates bytes needed to encode the field, enabled for integer. More...
 
template<class Type , typename Enabler = std::enable_if_t< std::is_floating_point<std::decay_t<Type>>::value>>
static size_t count_write_bytes (const Type &, int=0)
 Calculates bytes needed to encode the field, enabled for non-integer types (float/double) More...
 
static size_t count_write_bytes (const std::string &arg)
 Calculates bytes needed to encode the unbounded string. More...
 

Detailed Description

Specialization of Byte_count_helper for 0 field_size.

0 means default. Default choice for integer is variable-length encoding (1-9 bytes). Default choice for a string is unlimited size (un-bounded string)

Member Function Documentation

◆ count_write_bytes() [1/3]

static size_t mysql::serialization::Byte_count_helper< 0 >::count_write_bytes ( const std::string &  arg)
inlinestatic

Calculates bytes needed to encode the unbounded string.

Parameters
argString argument needed to be encoded
Returns
Bytes needed to encode the "arg" field

◆ count_write_bytes() [2/3]

template<class Type , typename Enabler = std::enable_if_t< std::is_floating_point<std::decay_t<Type>>::value>>
static size_t mysql::serialization::Byte_count_helper< 0 >::count_write_bytes ( const Type &  ,
int  = 0 
)
inlinestatic

Calculates bytes needed to encode the field, enabled for non-integer types (float/double)

Template Parameters
Typeof the field, as represented in the code
Returns
Bytes needed to encode the "arg" field

◆ count_write_bytes() [3/3]

template<class Type , typename Enabler = std::enable_if_t< std::is_integral<std::decay_t<Type>>::value>>
static size_t mysql::serialization::Byte_count_helper< 0 >::count_write_bytes ( const Type &  arg)
inlinestatic

Calculates bytes needed to encode the field, enabled for integer.

Template Parameters
Typeof the field, as represented in the code
Parameters
argVariable we need to encode
Returns
Bytes needed to encode the "arg" field

The documentation for this struct was generated from the following file: