MySQL 9.1.0
Source Code Documentation
mysql::serialization::Byte_count_helper< field_size > Struct Template Reference

Structure that contains methods to count the number of bytes needed to encode a specific field. 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 &)
 Calculates bytes needed to encode the field. More...
 
static size_t count_write_bytes (const std::string &arg)
 Calculates bytes needed to encode the bounded string field (specialization of count_write_bytes for string type) More...
 

Detailed Description

template<Field_size field_size>
struct mysql::serialization::Byte_count_helper< field_size >

Structure that contains methods to count the number of bytes needed to encode a specific field.

Template Parameters
field_sizeThe number of bytes requested by the user. 0 means "default". For string, field_size is the boundary length of the string

Member Function Documentation

◆ count_write_bytes() [1/2]

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

Calculates bytes needed to encode the bounded string field (specialization of count_write_bytes for string type)

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

◆ count_write_bytes() [2/2]

template<Field_size field_size>
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< field_size >::count_write_bytes ( const Type &  )
inlinestatic

Calculates bytes needed to encode the field.

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

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