BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
GWSOutputQueue.h
1 #pragma once
2 
3 #include <queue>
4 
5 #include <Poco/Event.h>
6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
8 
9 #include "server/GWMessageContext.h"
10 #include "util/Loggable.h"
11 
12 namespace BeeeOn {
13 
18 class GWSOutputQueue : public Loggable {
19 public:
20  GWSOutputQueue(Poco::Event &enqueueEvent);
21  virtual ~GWSOutputQueue();
22 
23  void enqueue(GWMessageContext::Ptr context);
24 
25  GWMessageContext::Ptr dequeue();
26 
27  void clear();
28 
29 private:
30  std::priority_queue<GWMessageContext::Ptr,
31  std::vector<GWMessageContext::Ptr>,
33 
34  Poco::FastMutex m_mutex;
35  Poco::Event &m_enqueueEvent;
36 };
37 
38 }
Definition: GWMessageContext.h:137
Queue for all outgoing messages. Must be initialized with Poco::Event reference, which is notified on...
Definition: GWSOutputQueue.h:18
Definition: Loggable.h:19