mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 13:21:50 -05:00
32 lines
496 B
C
32 lines
496 B
C
|
#ifndef INCLUDE_MESSAGEQUEUE_H
|
||
|
#define INCLUDE_MESSAGEQUEUE_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QQueue>
|
||
|
#include "spinlock.h"
|
||
|
#include "util/export.h"
|
||
|
|
||
|
class Message;
|
||
|
|
||
|
class SDRANGELOVE_API MessageQueue : public QObject {
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
MessageQueue(QObject* parent = NULL);
|
||
|
~MessageQueue();
|
||
|
|
||
|
void submit(Message* message);
|
||
|
Message* accept();
|
||
|
|
||
|
int countPending();
|
||
|
|
||
|
signals:
|
||
|
void messageEnqueued();
|
||
|
|
||
|
private:
|
||
|
Spinlock m_lock;
|
||
|
QQueue<Message*> m_queue;
|
||
|
};
|
||
|
|
||
|
#endif // INCLUDE_MESSAGEQUEUE_H
|