Specialization of Byte_count_helper for 0 field_size.
More...
#include <primitive_type_codec.h>
|
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...
|
|
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)
◆ count_write_bytes() [1/3]
Calculates bytes needed to encode the unbounded string.
- Parameters
-
arg | String 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>>
Calculates bytes needed to encode the field, enabled for non-integer types (float/double)
- Template Parameters
-
Type | of 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>>
Calculates bytes needed to encode the field, enabled for integer.
- Template Parameters
-
Type | of the field, as represented in the code |
- Parameters
-
arg | Variable we need to encode |
- Returns
- Bytes needed to encode the "arg" field
The documentation for this struct was generated from the following file: