|
|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
//
|
|
|
|
|
// Created by Jean-Luc on 05/12/2015.
|
|
|
|
|
// Copyright © 2015 Jean-Luc. All rights reserved.
|
|
|
|
|
// Copyright © 2020 Thomas A. Early, N7TAE
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
// This file is part of xlxd.
|
|
|
|
|
@ -27,6 +28,9 @@
|
|
|
|
|
#ifndef cnotificationqueue_h
|
|
|
|
|
#define cnotificationqueue_h
|
|
|
|
|
|
|
|
|
|
#include <queue>
|
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
|
|
#include "cnotification.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -35,22 +39,29 @@
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// class
|
|
|
|
|
|
|
|
|
|
class CNotificationQueue : public std::queue<CNotification>
|
|
|
|
|
class CNotificationQueue
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// constructor
|
|
|
|
|
CNotificationQueue() {};
|
|
|
|
|
CNotificationQueue() {}
|
|
|
|
|
|
|
|
|
|
// destructor
|
|
|
|
|
~CNotificationQueue() {};
|
|
|
|
|
~CNotificationQueue() {}
|
|
|
|
|
|
|
|
|
|
// lock
|
|
|
|
|
void Lock() { m_Mutex.lock(); }
|
|
|
|
|
void Unlock() { m_Mutex.unlock(); }
|
|
|
|
|
|
|
|
|
|
// pass thru
|
|
|
|
|
CNotification front() { return queue.front(); }
|
|
|
|
|
void pop() { queue.pop(); }
|
|
|
|
|
void push(CNotification note) { queue.push(note); }
|
|
|
|
|
bool empty() const { return queue.empty(); }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// data
|
|
|
|
|
std::mutex m_Mutex;
|
|
|
|
|
std::queue<CNotification> queue;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|