OMOTE/Platformio/HAL/Targets/ESP32/freeRTOSMPMCQueue.hpp
2023-09-14 06:34:04 +02:00

18 lines
No EOL
456 B
C++

#pragma once
#include "MPMCQueueInterface.hpp"
#include "Arduino.h"
template <typename T>
class freeRTOSMPMCQueue: public MPMCQueueInterface<T>
{
public:
freeRTOSMPMCQueue(uint32_t size);
~freeRTOSMPMCQueue();
bool push (T obj);
bool push (T obj, bool overwrite);
std::optional<T> pop();
std::optional<T> peek();
bool isFull();
bool isEmpty();
private:
QueueHandle_t queue;
};