11#include <condition_variable>
24 int32_t mElementCount;
25 std::mutex mOrderedQueueMutex;
26 std::condition_variable mOrderedQueueCondition;
29 struct QueueOrdering {
31 return a->getPriority() > b->getPriority();
39 std::priority_queue<Message*, std::vector<Message*>, QueueOrdering>
mOrderedQueue;
Base-Type for Request and Signal classes.
This class represents a mutex-protected multiple producer, single consumer priority queue.
Message * pop()
Used by the consumer end to poll a request from the OrderedQueue.
void wait()
Used by the Consumer end to wait for Requests.
virtual void orderedQueueConsumerHook()=0
Provides a mechanism, to hook or plug-in the Consumer Code.
int8_t addAndWakeup(Message *req)
Used by the producers to add a new request to the OrderedQueue.
std::priority_queue< Message *, std::vector< Message * >, QueueOrdering > mOrderedQueue
Core OrderedQueue Data Structure, to store the Requests pushed by the Publisher threads....
int8_t hasPendingTasks()
Used by the consumer to check if there are any pending requests in the OrderedQueue.