std::atomic< bool > m_ShouldTerminate
The overriden Execute() method should check this value periodically and terminate if this is true.
void Stop(void)
Signals the thread to terminate and waits until it's finished.
virtual ~cNetworkLookup() override
virtual void Execute() override final
Process the queue until the thread is stopped.
void ScheduleLookup(std::function< void()> a_Lookup)
Schedule a lookup task for execution.
void Stop()
Cancels any scheduled lookups and joins the lookup thread.
cQueue< std::function< void()> > m_WorkQueue
The queue of lookup tasks waiting to be executed.
void EnqueueItem(ItemType a_Item)
Enqueues an item to the queue, may block if other threads are accessing the queue.
void Clear(void)
Removes all Items from the Queue, calling Delete on each of them.
ItemType DequeueItem(void)
Dequeues an item from the queue, blocking until an item is available.