no class is derived from container

pull/1/head
Tom Early 6 years ago
parent c92db03398
commit e6f4096f2c

@ -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;
};
////////////////////////////////////////////////////////////////////////////////////////

@ -4,6 +4,7 @@
//
// Created by Jean-Luc Deltombe (LX3JL) on 02/11/2015.
// Copyright © 2015 Jean-Luc Deltombe (LX3JL). All rights reserved.
// Copyright © 2020 Thomas A. Early, N7TAE
//
// ----------------------------------------------------------------------------
// This file is part of xlxd.
@ -35,19 +36,34 @@
class CClient;
class CPacketQueue : public std::queue<CPacket *>
class CPacketQueue
{
public:
// constructor
CPacketQueue() {};
CPacketQueue() {}
// destructor
~CPacketQueue() {};
~CPacketQueue()
{
Lock();
while (! queue.empty())
{
delete queue.front();
queue.pop();
}
Unlock();
}
// lock
void Lock() { m_Mutex.lock(); }
void Unlock() { m_Mutex.unlock(); }
// pass thru
CPacket *front() { return queue.front(); }
void pop() { queue.pop(); }
void push(CPacket *packet) { queue.push(packet); }
bool empty() const { return queue.empty(); }
protected:
// status
bool m_bOpen;
@ -56,6 +72,7 @@ protected:
// owner
CClient *m_Client;
std::queue<CPacket *> queue;
};
////////////////////////////////////////////////////////////////////////////////////////

@ -4,6 +4,7 @@
//
// Created by Jean-Luc Deltombe (LX3JL) on 09/10/2019.
// Copyright © 2019 Jean-Luc Deltombe (LX3JL). All rights reserved.
// Copyright © 2020 Thomas A. Early, N7TAE
//
// ----------------------------------------------------------------------------
// This file is part of xlxd.
@ -33,22 +34,29 @@
////////////////////////////////////////////////////////////////////////////////////////
// class
class CWiresxCmdQueue : public std::queue<CWiresxCmd>
class CWiresxCmdQueue
{
public:
// constructor
CWiresxCmdQueue() {};
CWiresxCmdQueue() {}
// destructor
~CWiresxCmdQueue() {};
~CWiresxCmdQueue() {}
// lock
void Lock() { m_Mutex.lock(); }
void Unlock() { m_Mutex.unlock(); }
// pass thru
CWiresxCmd front() { return queue.front(); }
void pop() { queue.pop(); }
void push(CWiresxCmd cmd) { queue.push(cmd); }
bool empty() const { return queue.empty(); }
protected:
// status
std::mutex m_Mutex;
std::queue<CWiresxCmd> queue;
};
////////////////////////////////////////////////////////////////////////////////////////

@ -4,6 +4,7 @@
//
// Created by Jean-Luc Deltombe (LX3JL) on 09/10/2019.
// Copyright © 2019 Jean-Luc Deltombe (LX3JL). All rights reserved.
// Copyright © 2020 Thomas A. Early, N7TAE
//
// ----------------------------------------------------------------------------
// This file is part of xlxd.
@ -32,22 +33,29 @@
////////////////////////////////////////////////////////////////////////////////////////
// class
class CWiresxPacketQueue : public std::queue<CWiresxPacket>
class CWiresxPacketQueue
{
public:
// constructor
CWiresxPacketQueue() {};
CWiresxPacketQueue() {}
// destructor
~CWiresxPacketQueue() {};
~CWiresxPacketQueue() {}
// lock
void Lock() { m_Mutex.lock(); }
void Unlock() { m_Mutex.unlock(); }
// pass thru
CWiresxPacket front() { return queue.front(); }
void pop() { queue.pop(); }
void push(CWiresxPacket packet) { queue.push(packet); }
bool empty() const { return queue.empty(); }
protected:
// status
std::mutex m_Mutex;
std::queue<CWiresxPacket> queue;
};
////////////////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save

Powered by TurnKey Linux.