Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <NetworkLookup.h>
Public Member Functions | |
cNetworkLookup () | |
void | ScheduleLookup (std::function< void()> a_Lookup) |
Schedule a lookup task for execution. More... | |
void | Stop () |
Cancels any scheduled lookups and joins the lookup thread. More... | |
virtual | ~cNetworkLookup () override |
Public Member Functions inherited from cIsThread | |
cIsThread (AString &&a_ThreadName) | |
bool | IsCurrentThread (void) const |
Returns true if the thread calling this function is the thread contained within this object. More... | |
void | Start (void) |
Starts the thread; returns without waiting for the actual start. More... | |
void | Stop (void) |
Signals the thread to terminate and waits until it's finished. More... | |
virtual | ~cIsThread () |
Protected Member Functions | |
virtual void | Execute () override final |
Process the queue until the thread is stopped. More... | |
Private Attributes | |
cQueue< std::function< void()> > | m_WorkQueue |
The queue of lookup tasks waiting to be executed. More... | |
Additional Inherited Members | |
Protected Attributes inherited from cIsThread | |
std::atomic< bool > | m_ShouldTerminate |
The overriden Execute() method should check this value periodically and terminate if this is true. More... | |
Definition at line 17 of file NetworkLookup.h.
cNetworkLookup::cNetworkLookup | ( | ) |
Definition at line 13 of file NetworkLookup.cpp.
|
overridevirtual |
Definition at line 22 of file NetworkLookup.cpp.
|
finaloverrideprotectedvirtual |
Process the queue until the thread is stopped.
Implements cIsThread.
Definition at line 52 of file NetworkLookup.cpp.
void cNetworkLookup::ScheduleLookup | ( | std::function< void()> | a_Lookup | ) |
Schedule a lookup task for execution.
Definition at line 31 of file NetworkLookup.cpp.
void cNetworkLookup::Stop | ( | void | ) |
Cancels any scheduled lookups and joins the lookup thread.
Definition at line 40 of file NetworkLookup.cpp.
|
private |
The queue of lookup tasks waiting to be executed.
Definition at line 39 of file NetworkLookup.h.