Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cNetworkLookup Class Reference

#include <NetworkLookup.h>

Inheritance diagram for cNetworkLookup:
Inheritance graph
[legend]
Collaboration diagram for cNetworkLookup:
Collaboration graph
[legend]

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 (const AString &a_ThreadName)
 
bool IsCurrentThread (void) const
 Returns true if the thread calling this function is the thread contained within this object. More...
 
bool 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...
 
bool Wait (void)
 Waits for the thread to finish. More...
 
virtual ~cIsThread ()
 

Protected Member Functions

virtual void Execute () overridefinal
 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...
 

Detailed Description

Definition at line 17 of file NetworkLookup.h.

Constructor & Destructor Documentation

cNetworkLookup::cNetworkLookup ( )

Definition at line 13 of file NetworkLookup.cpp.

cNetworkLookup::~cNetworkLookup ( )
overridevirtual

Definition at line 22 of file NetworkLookup.cpp.

Member Function Documentation

void cNetworkLookup::Execute ( void  )
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.

Member Data Documentation

cQueue<std::function<void()> > cNetworkLookup::m_WorkQueue
private

The queue of lookup tasks waiting to be executed.

Definition at line 39 of file NetworkLookup.h.


The documentation for this class was generated from the following files: