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

#include <BoostAsioThreadGroup.h>

Collaboration diagram for Skyfire::Asio::IoContextThreadGroup:

Public Types

typedef std::function< void()> Hook

Public Member Functions

void Drain ()
void DrainAndJoin ()
IoContextExecutorGetExecutor ()
boost::asio::io_context & GetIoContext ()
 IoContextThreadGroup ()
bool IsRunning () const
void Join ()
int Start (std::size_t threadCount, Hook preRun=Hook(), Hook postRun=Hook())
void Stop ()
void StopAndJoin ()
 ~IoContextThreadGroup ()

Private Attributes

IoContextExecutor _executor
Hook _postRun
Hook _preRun
std::atomic< bool > _running
std::vector< std::unique_ptr< IoContextThread > > _threads

Detailed Description

Definition at line 22 of file BoostAsioThreadGroup.h.

Member Typedef Documentation

◆ Hook

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

Definition at line 25 of file BoostAsioThreadGroup.h.

Constructor & Destructor Documentation

◆ IoContextThreadGroup()

Skyfire::Asio::IoContextThreadGroup::IoContextThreadGroup ( )
inline

Definition at line 27 of file BoostAsioThreadGroup.h.

References _executor, and _running.

◆ ~IoContextThreadGroup()

Skyfire::Asio::IoContextThreadGroup::~IoContextThreadGroup ( )
inline

Definition at line 29 of file BoostAsioThreadGroup.h.

References StopAndJoin().

Member Function Documentation

◆ Drain()

void Skyfire::Asio::IoContextThreadGroup::Drain ( )
inline

Definition at line 75 of file BoostAsioThreadGroup.h.

References _executor.

Referenced by DrainAndJoin().

◆ DrainAndJoin()

void Skyfire::Asio::IoContextThreadGroup::DrainAndJoin ( )
inline

Definition at line 97 of file BoostAsioThreadGroup.h.

References Drain(), and Join().

◆ GetExecutor()

IoContextExecutor & Skyfire::Asio::IoContextThreadGroup::GetExecutor ( )
inline

Definition at line 34 of file BoostAsioThreadGroup.h.

References _executor.

◆ GetIoContext()

boost::asio::io_context & Skyfire::Asio::IoContextThreadGroup::GetIoContext ( )
inline

Definition at line 35 of file BoostAsioThreadGroup.h.

References _executor.

◆ IsRunning()

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

Definition at line 36 of file BoostAsioThreadGroup.h.

References _running.

◆ Join()

void Skyfire::Asio::IoContextThreadGroup::Join ( )
inline

Definition at line 86 of file BoostAsioThreadGroup.h.

References _postRun, _preRun, _running, and _threads.

Referenced by DrainAndJoin(), and StopAndJoin().

◆ Start()

int Skyfire::Asio::IoContextThreadGroup::Start ( std::size_t threadCount,
Hook preRun = Hook(),
Hook postRun = Hook() )
inline

Definition at line 38 of file BoostAsioThreadGroup.h.

References _executor, _postRun, _preRun, _running, _threads, and StopAndJoin().

◆ Stop()

void Skyfire::Asio::IoContextThreadGroup::Stop ( )
inline

Definition at line 80 of file BoostAsioThreadGroup.h.

References _executor.

Referenced by StopAndJoin().

◆ StopAndJoin()

void Skyfire::Asio::IoContextThreadGroup::StopAndJoin ( )
inline

Definition at line 103 of file BoostAsioThreadGroup.h.

References Join(), and Stop().

Referenced by Start(), and ~IoContextThreadGroup().

Member Data Documentation

◆ _executor

IoContextExecutor Skyfire::Asio::IoContextThreadGroup::_executor
private

◆ _postRun

Hook Skyfire::Asio::IoContextThreadGroup::_postRun
private

Definition at line 113 of file BoostAsioThreadGroup.h.

Referenced by Join(), and Start().

◆ _preRun

Hook Skyfire::Asio::IoContextThreadGroup::_preRun
private

Definition at line 112 of file BoostAsioThreadGroup.h.

Referenced by Join(), and Start().

◆ _running

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

Definition at line 114 of file BoostAsioThreadGroup.h.

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

◆ _threads

std::vector<std::unique_ptr<IoContextThread> > Skyfire::Asio::IoContextThreadGroup::_threads
private

Definition at line 111 of file BoostAsioThreadGroup.h.

Referenced by Join(), and Start().


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