eventqueue.h
#ifndef XF_IDF_STM32_EVENT_QUEUE_H
#define XF_IDF_STM32_EVENT_QUEUE_H
#ifdef __cplusplus
#include "config/xf-config.h"
#if (USE_XF_IDF_STM32_EVENT_QUEUE_CLASS != 0)
#include <stdint.h>
#include <queue>
#include "xf/interface/eventqueue.h"
#include "mutex.h"
class XFEventQueue : public interface::XFEventQueue
{
using Mutex = XFMutex;
public:
XFEventQueue();
virtual ~XFEventQueue();
// XFEventQueue interface implementation
public:
bool empty() const override;
bool push(const XFEvent * pEvent, bool fromISR = false) override;
const XFEvent * front() override;
void pop() override;
bool pend() override;
protected:
typedef std::queue<const XFEvent *> EventQueue;
Mutex mutex_;
EventQueue queue_;
};
// end of port_idf_stm32 group
#endif // USE_XF_IDF_STM32_EVENT_QUEUE_CLASS
#endif // __cplusplus
#endif // XF_IDF_STM32_EVENT_QUEUE_H
XFEvent
Base class for all types of events and timeouts.
Definition: event.h:23
XFEventQueue
Default Qt implementation for the XFEventQueue interface.
Definition: eventqueue.h:22
XFEventQueue::empty
bool empty() const override
Returns true if no event is in the queue.
XFEventQueue::queue_
EventQueue queue_
Internal queue holding the events.
Definition: eventqueue.h:40
XFEventQueue::pop
void pop() override
Pops the next event from the queue.
XFEventQueue::pend
bool pend() override
Wait for the next event to arrive. Returns true if an event is in the queue.
XFEventQueue::mutex_
Mutex mutex_
Mutex protecting access to queue_.
Definition: eventqueue.h:42
XFEventQueue::front
const XFEvent * front() override
Returns pointer to next event to pop.
XFEventQueue::push
bool push(const XFEvent *pEvent, bool fromISR=false) override
Pushes the given event onto the queue.
XFEventQueue::EventQueue
std::queue< const XFEvent * > EventQueue
Type of the event queue.
Definition: eventqueue.h:40
XFEventQueue::EventQueue
QQueue< const XFEvent * > EventQueue
Type of the event queue.
Definition: eventqueue.h:36
XFMutex
Default Qt implementation for the XFMutex interface.
Definition: mutex.h:20
interface::XFEventQueue
Interface to be implemented by the event queue.
Definition: eventqueue.h:12
interface::XFMutex
Mutex interface needed by the XF to access a mutex.
Definition: mutex.h:18