Class MT_buffer

Class Documentation

class MT_buffer

This class is a bulk sequence of bytes with MultiThread (MT)-safe read and write operations.

Public Functions

MT_buffer() = default

Default constructor

virtual ~MT_buffer() = default

Destructor

inline void clear()

Empty the buffer

inline size_t size()

Return the number of available bytes at this moment.

inline void appendData(const std::vector<uint8_t> &d)

Append new data to the stream

inline void readAndClear(std::vector<uint8_t> &d)

Read the whole buffer and empty it.

inline void read(std::vector<uint8_t> &d)

Read the whole buffer.