unilink  0.4.3
A simple C++ library for unified async communication
unilink::concurrency::IoContextManager Class Reference

#include <io_context_manager.hpp>

Classes

struct  Impl
 

Public Types

using IoContext = boost::asio::io_context
 
using WorkGuard = boost::asio::executor_work_guard< IoContext::executor_type >
 

Public Member Functions

 IoContextManager ()
 
 IoContextManager (std::shared_ptr< IoContext > external_context)
 
 IoContextManager (IoContext &external_context)
 
 ~IoContextManager ()
 
 IoContextManager (IoContextManager &&) noexcept
 
IoContextManageroperator= (IoContextManager &&) noexcept
 
 IoContextManager (const IoContextManager &)=delete
 
IoContextManageroperator= (const IoContextManager &)=delete
 
IoContextget_context ()
 
void start ()
 
void stop ()
 
bool is_running () const
 
std::unique_ptr< IoContextcreate_independent_context ()
 

Static Public Member Functions

static IoContextManagerinstance ()
 

Detailed Description

Global io_context manager All Transports share one io_context for improved memory efficiency

Definition at line 32 of file io_context_manager.hpp.

Member Typedef Documentation

◆ IoContext

using unilink::concurrency::IoContextManager::IoContext = boost::asio::io_context

Definition at line 34 of file io_context_manager.hpp.

◆ WorkGuard

using unilink::concurrency::IoContextManager::WorkGuard = boost::asio::executor_work_guard<IoContext::executor_type>

Definition at line 35 of file io_context_manager.hpp.

Constructor & Destructor Documentation

◆ IoContextManager() [1/5]

unilink::concurrency::IoContextManager::IoContextManager ( )

Definition at line 101 of file io_context_manager.cc.

◆ IoContextManager() [2/5]

unilink::concurrency::IoContextManager::IoContextManager ( std::shared_ptr< IoContext external_context)
explicit

Definition at line 103 of file io_context_manager.cc.

◆ IoContextManager() [3/5]

unilink::concurrency::IoContextManager::IoContextManager ( IoContext external_context)
explicit

Definition at line 106 of file io_context_manager.cc.

◆ ~IoContextManager()

unilink::concurrency::IoContextManager::~IoContextManager ( )
default

◆ IoContextManager() [4/5]

unilink::concurrency::IoContextManager::IoContextManager ( IoContextManager &&  )
defaultnoexcept

◆ IoContextManager() [5/5]

unilink::concurrency::IoContextManager::IoContextManager ( const IoContextManager )
delete

Member Function Documentation

◆ create_independent_context()

std::unique_ptr< boost::asio::io_context > unilink::concurrency::IoContextManager::create_independent_context ( )

Definition at line 177 of file io_context_manager.cc.

◆ get_context()

boost::asio::io_context & unilink::concurrency::IoContextManager::get_context ( )

Definition at line 115 of file io_context_manager.cc.

◆ instance()

IoContextManager & unilink::concurrency::IoContextManager::instance ( )
static

Definition at line 110 of file io_context_manager.cc.

◆ is_running()

bool unilink::concurrency::IoContextManager::is_running ( ) const

Definition at line 175 of file io_context_manager.cc.

◆ operator=() [1/2]

IoContextManager& unilink::concurrency::IoContextManager::operator= ( const IoContextManager )
delete

◆ operator=() [2/2]

IoContextManager & unilink::concurrency::IoContextManager::operator= ( IoContextManager &&  )
defaultnoexcept

◆ start()

void unilink::concurrency::IoContextManager::start ( )

Definition at line 124 of file io_context_manager.cc.

◆ stop()

void unilink::concurrency::IoContextManager::stop ( )

Definition at line 173 of file io_context_manager.cc.


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