Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Skyfire::Asio::IoContextThread Class Reference

#include <BoostAsioThread.h>

Public Types

typedef std::function< void()> Hook

Public Member Functions

 IoContextThread ()
bool IsRunning () const
int Join ()
int Start (IoContextExecutor &executor, Hook preRun=Hook(), Hook postRun=Hook())
 ~IoContextThread ()

Private Member Functions

void Run (IoContextExecutor *executor)

Private Attributes

Hook _postRun
Hook _preRun
std::atomic< bool > _running
std::thread _thread

Detailed Description

Definition at line 20 of file BoostAsioThread.h.

Member Typedef Documentation

◆ Hook

typedef std::function<void()> Skyfire::Asio::IoContextThread::Hook

Definition at line 23 of file BoostAsioThread.h.

Constructor & Destructor Documentation

◆ IoContextThread()

Skyfire::Asio::IoContextThread::IoContextThread ( )
inline

Definition at line 25 of file BoostAsioThread.h.

References _running.

◆ ~IoContextThread()

Skyfire::Asio::IoContextThread::~IoContextThread ( )
inline

Definition at line 27 of file BoostAsioThread.h.

References Join().

Member Function Documentation

◆ IsRunning()

bool Skyfire::Asio::IoContextThread::IsRunning ( ) const
inline

Definition at line 32 of file BoostAsioThread.h.

References _running.

◆ Join()

int Skyfire::Asio::IoContextThread::Join ( )
inline

Definition at line 58 of file BoostAsioThread.h.

References _postRun, _preRun, _running, and _thread.

Referenced by ~IoContextThread().

◆ Run()

void Skyfire::Asio::IoContextThread::Run ( IoContextExecutor * executor)
inlineprivate

Definition at line 70 of file BoostAsioThread.h.

References _postRun, _preRun, and Skyfire::Asio::IoContextExecutor::Run().

Referenced by Start().

◆ Start()

int Skyfire::Asio::IoContextThread::Start ( IoContextExecutor & executor,
Hook preRun = Hook(),
Hook postRun = Hook() )
inline

Definition at line 34 of file BoostAsioThread.h.

References _postRun, _preRun, _running, _thread, and Run().

Member Data Documentation

◆ _postRun

Hook Skyfire::Asio::IoContextThread::_postRun
private

Definition at line 83 of file BoostAsioThread.h.

Referenced by Join(), Run(), and Start().

◆ _preRun

Hook Skyfire::Asio::IoContextThread::_preRun
private

Definition at line 82 of file BoostAsioThread.h.

Referenced by Join(), Run(), and Start().

◆ _running

std::atomic<bool> Skyfire::Asio::IoContextThread::_running
private

Definition at line 84 of file BoostAsioThread.h.

Referenced by IoContextThread(), IsRunning(), Join(), and Start().

◆ _thread

std::thread Skyfire::Asio::IoContextThread::_thread
private

Definition at line 81 of file BoostAsioThread.h.

Referenced by Join(), and Start().


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