group datastream

Defines data stream for reading and writing data in the form of bytes.

Functions Documentation

function unpack

T datastream::unpack (
    const char * buffer,
    size_t len
)

Unpack data inside a fixed size buffer as T.

Unpack data inside a fixed size buffer as T

Template parameters:

  • T - Type of the unpacked data

Parameters:

  • buffer - Pointer to the buffer
  • len - Length of the buffer

Returns:

T - The unpacked data

function unpack

T datastream::unpack (
    const std::vector< char > & bytes
)

Unpack data inside a variable size buffer as T.

Unpack data inside a variable size buffer as T

Template parameters:

  • T - Type of the unpacked data

Parameters:

  • bytes - Buffer

Returns:

T - The unpacked data

function pack_size

size_t datastream::pack_size (
    const T & value
)

Get the size of the packed data.

Get the size of the packed data

Template parameters:

  • T - Type of the data to be packed

Parameters:

  • value - Data to be packed

Returns:

size_t - Size of the packed data

function pack

std::vector< char > datastream::pack (
    const T & value
)

Get packed data.

Get packed data

Template parameters:

  • T - Type of the data to be packed

Parameters:

  • value - Data to be packed

Returns:

bytes - The packed data

results matching ""

    No results matching ""