MySQL 9.1.0
Source Code Documentation
mysql::serialization::Primitive_type_codec< Type > Struct Template Reference

This class is to provide functionality to encode/decode the primitive types into/out of defined stream, without boundary check. More...

#include <primitive_type_codec.h>

Public Member Functions

size_t write_bytes (unsigned char *stream, const uint8_t &data)
 
size_t write_bytes (unsigned char *stream, const uint16_t &data)
 
size_t write_bytes (unsigned char *stream, const uint32_t &data)
 
size_t write_bytes (unsigned char *stream, const uint32_t &data)
 
size_t write_bytes (unsigned char *stream, const uint64_t &data)
 
size_t write_bytes (unsigned char *stream, const uint64_t &data)
 
size_t write_bytes (unsigned char *stream, const uint64_t &data)
 
size_t write_bytes (unsigned char *stream, const uint64_t &data)
 
size_t write_bytes (unsigned char *stream, const float &data)
 
size_t write_bytes (unsigned char *stream, const double &data)
 
size_t write_bytes (unsigned char *stream, const float &data)
 
size_t write_bytes (unsigned char *stream, const double &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint8_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint16_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint32_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint32_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, float &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, double &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, float &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, double &data)
 
size_t write_bytes (unsigned char *stream, const int8_t &data)
 
size_t write_bytes (unsigned char *stream, const uint8_t &data)
 
size_t write_bytes (unsigned char *stream, const int16_t &data)
 
size_t write_bytes (unsigned char *stream, const uint16_t &data)
 
size_t write_bytes (unsigned char *stream, const int32_t &data)
 
size_t write_bytes (unsigned char *stream, const uint32_t &data)
 
size_t write_bytes (unsigned char *stream, const int64_t &data)
 
size_t write_bytes (unsigned char *stream, const uint64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, int8_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint8_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, int16_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint16_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, int32_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint32_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, int64_t &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, uint64_t &data)
 
size_t write_bytes (unsigned char *stream, const std::string &data)
 
size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, std::string &data)
 

Static Public Member Functions

template<Field_size field_size>
static size_t write_bytes (unsigned char *stream, const Type &data)
 Writes field_size bytes stored in data into stream. More...
 
template<Field_size field_size>
static size_t read_bytes (const unsigned char *stream, std::size_t stream_bytes, Type &data)
 Reads field_size bytes stored in the stream into data. More...
 
template<Field_size field_size>
static size_t count_write_bytes (const Type &data)
 Returns number of bytes required to hold information Returns field_size or size of bytes required to write variable length data. More...
 

Detailed Description

template<class Type>
struct mysql::serialization::Primitive_type_codec< Type >

This class is to provide functionality to encode/decode the primitive types into/out of defined stream, without boundary check.

Template Parameters
TypeType of the field being read / written

Member Function Documentation

◆ count_write_bytes()

template<class Type >
template<Field_size field_size>
static size_t mysql::serialization::Primitive_type_codec< Type >::count_write_bytes ( const Type &  data)
inlinestatic

Returns number of bytes required to hold information Returns field_size or size of bytes required to write variable length data.

Template Parameters
field_sizeNumber of bytes stored in the stream
Parameters
[in]dataCount bytes for this variable
Returns
Number of bytes that will be read

◆ read_bytes() [1/22]

size_t mysql::serialization::Primitive_type_codec< double >::read_bytes< 8 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
double &  data 
)

◆ read_bytes() [2/22]

size_t mysql::serialization::Primitive_type_codec< double >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
double &  data 
)

◆ read_bytes() [3/22]

size_t mysql::serialization::Primitive_type_codec< float >::read_bytes< 4 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
float &  data 
)

◆ read_bytes() [4/22]

size_t mysql::serialization::Primitive_type_codec< float >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
float &  data 
)

◆ read_bytes() [5/22]

size_t mysql::serialization::Primitive_type_codec< int16_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
int16_t &  data 
)

◆ read_bytes() [6/22]

size_t mysql::serialization::Primitive_type_codec< int32_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
int32_t &  data 
)

◆ read_bytes() [7/22]

size_t mysql::serialization::Primitive_type_codec< int64_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
int64_t &  data 
)

◆ read_bytes() [8/22]

size_t mysql::serialization::Primitive_type_codec< int8_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
int8_t &  data 
)

◆ read_bytes() [9/22]

size_t mysql::serialization::Primitive_type_codec< std::string >::read_bytes ( const unsigned char *  stream,
std::size_t  stream_bytes,
std::string &  data 
)

◆ read_bytes() [10/22]

template<class Type >
template<Field_size field_size>
static size_t mysql::serialization::Primitive_type_codec< Type >::read_bytes ( const unsigned char *  stream,
std::size_t  stream_bytes,
Type &  data 
)
static

Reads field_size bytes stored in the stream into data.

Template Parameters
field_sizeNumber of bytes stored in the stream
Parameters
[in]streamInput stream
[in]stream_bytesNumber of bytes in the stream
[in,out]dataOutput value
Returns
Number of bytes read or 0 on error

◆ read_bytes() [11/22]

size_t mysql::serialization::Primitive_type_codec< uint16_t >::read_bytes< 2 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint16_t &  data 
)

◆ read_bytes() [12/22]

size_t mysql::serialization::Primitive_type_codec< uint16_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint16_t &  data 
)

◆ read_bytes() [13/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::read_bytes< 3 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint32_t &  data 
)

◆ read_bytes() [14/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::read_bytes< 4 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint32_t &  data 
)

◆ read_bytes() [15/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint32_t &  data 
)

◆ read_bytes() [16/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::read_bytes< 5 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint64_t &  data 
)

◆ read_bytes() [17/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::read_bytes< 6 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint64_t &  data 
)

◆ read_bytes() [18/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::read_bytes< 7 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint64_t &  data 
)

◆ read_bytes() [19/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::read_bytes< 8 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint64_t &  data 
)

◆ read_bytes() [20/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint64_t &  data 
)

◆ read_bytes() [21/22]

size_t mysql::serialization::Primitive_type_codec< uint8_t >::read_bytes< 1 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint8_t &  data 
)

◆ read_bytes() [22/22]

size_t mysql::serialization::Primitive_type_codec< uint8_t >::read_bytes< 0 > ( const unsigned char *  stream,
std::size_t  stream_bytes,
uint8_t &  data 
)

◆ write_bytes() [1/22]

size_t mysql::serialization::Primitive_type_codec< double >::write_bytes< 8 > ( unsigned char *  stream,
const double &  data 
)

◆ write_bytes() [2/22]

size_t mysql::serialization::Primitive_type_codec< double >::write_bytes< 0 > ( unsigned char *  stream,
const double &  data 
)

◆ write_bytes() [3/22]

size_t mysql::serialization::Primitive_type_codec< float >::write_bytes< 4 > ( unsigned char *  stream,
const float &  data 
)

◆ write_bytes() [4/22]

size_t mysql::serialization::Primitive_type_codec< float >::write_bytes< 0 > ( unsigned char *  stream,
const float &  data 
)

◆ write_bytes() [5/22]

size_t mysql::serialization::Primitive_type_codec< int16_t >::write_bytes< 0 > ( unsigned char *  stream,
const int16_t &  data 
)

◆ write_bytes() [6/22]

size_t mysql::serialization::Primitive_type_codec< int32_t >::write_bytes< 0 > ( unsigned char *  stream,
const int32_t &  data 
)

◆ write_bytes() [7/22]

size_t mysql::serialization::Primitive_type_codec< int64_t >::write_bytes< 0 > ( unsigned char *  stream,
const int64_t &  data 
)

◆ write_bytes() [8/22]

size_t mysql::serialization::Primitive_type_codec< int8_t >::write_bytes< 0 > ( unsigned char *  stream,
const int8_t &  data 
)

◆ write_bytes() [9/22]

size_t mysql::serialization::Primitive_type_codec< std::string >::write_bytes ( unsigned char *  stream,
const std::string &  data 
)

◆ write_bytes() [10/22]

template<class Type >
template<Field_size field_size>
static size_t mysql::serialization::Primitive_type_codec< Type >::write_bytes ( unsigned char *  stream,
const Type &  data 
)
static

Writes field_size bytes stored in data into stream.

Template Parameters
field_sizeNumber of bytes stored into the stream
Parameters
[in,out]streamOutput stream
[in]dataValue to write
Returns
Number of bytes written

◆ write_bytes() [11/22]

size_t mysql::serialization::Primitive_type_codec< uint16_t >::write_bytes< 2 > ( unsigned char *  stream,
const uint16_t &  data 
)

◆ write_bytes() [12/22]

size_t mysql::serialization::Primitive_type_codec< uint16_t >::write_bytes< 0 > ( unsigned char *  stream,
const uint16_t &  data 
)

◆ write_bytes() [13/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::write_bytes< 3 > ( unsigned char *  stream,
const uint32_t &  data 
)

◆ write_bytes() [14/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::write_bytes< 4 > ( unsigned char *  stream,
const uint32_t &  data 
)

◆ write_bytes() [15/22]

size_t mysql::serialization::Primitive_type_codec< uint32_t >::write_bytes< 0 > ( unsigned char *  stream,
const uint32_t &  data 
)

◆ write_bytes() [16/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::write_bytes< 5 > ( unsigned char *  stream,
const uint64_t &  data 
)

◆ write_bytes() [17/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::write_bytes< 6 > ( unsigned char *  stream,
const uint64_t &  data 
)

◆ write_bytes() [18/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::write_bytes< 7 > ( unsigned char *  stream,
const uint64_t &  data 
)

◆ write_bytes() [19/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::write_bytes< 8 > ( unsigned char *  stream,
const uint64_t &  data 
)

◆ write_bytes() [20/22]

size_t mysql::serialization::Primitive_type_codec< uint64_t >::write_bytes< 0 > ( unsigned char *  stream,
const uint64_t &  data 
)

◆ write_bytes() [21/22]

size_t mysql::serialization::Primitive_type_codec< uint8_t >::write_bytes< 1 > ( unsigned char *  stream,
const uint8_t &  data 
)

◆ write_bytes() [22/22]

size_t mysql::serialization::Primitive_type_codec< uint8_t >::write_bytes< 0 > ( unsigned char *  stream,
const uint8_t &  data 
)

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