class mrpt::containers::MT_buffer

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

#include <mrpt/containers/MT_buffer.h>

class MT_buffer
{
public:
    //
methods

    void clear();
    size_t size();
    void appendData(const std::vector<uint8_t>& d);
    void readAndClear(std::vector<uint8_t>& d);
    void read(std::vector<uint8_t>& d);
};

Methods

void clear()

Empty the buffer.

size_t size()

Return the number of available bytes at this moment.

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

Append new data to the stream.

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

Read the whole buffer and empty it.

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

Read the whole buffer.