Simplified XF 1.1.0

eventqueue.h
1#ifndef XF_IDF_STM32_EVENT_QUEUE_H
2#define XF_IDF_STM32_EVENT_QUEUE_H
3#ifdef __cplusplus
4
5#include "config/xf-config.h"
6
7#if (USE_XF_IDF_STM32_EVENT_QUEUE_CLASS != 0)
8
9#include <stdint.h>
10#include <queue>
11#include "xf/interface/eventqueue.h"
12#include "mutex.h"
13
24 class XFEventQueue : public interface::XFEventQueue
25{
26 using Mutex = XFMutex;
27 public:
28 XFEventQueue();
29 virtual ~XFEventQueue();
30
31 // XFEventQueue interface implementation
32 public:
33 bool empty() const override;
34 bool push(const XFEvent * pEvent, bool fromISR = false) override;
35 const XFEvent * front() override;
36 void pop() override;
37 bool pend() override;
38
39 protected:
40 typedef std::queue<const XFEvent *> EventQueue;
41
42 Mutex mutex_;
43 EventQueue queue_;
44};
45 // end of port_idf_stm32 group
47#endif // USE_XF_IDF_STM32_EVENT_QUEUE_CLASS
48#endif // __cplusplus
49#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