class mrpt::containers::MT_buffer

Overview

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:
    // construction

    MT_buffer();

    // 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);
};

Construction

MT_buffer()

Default constructor.

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.