Clementine
Public Member Functions | List of all members
asio::io_context::work Class Reference

(Deprecated: Use executor_work_guard.) Class to inform the io_context when it has work to do. More...

#include <io_context.hpp>

Public Member Functions

 work (asio::io_context &io_context)
 Constructor notifies the io_context that work is starting. More...
 
 work (const work &other)
 Copy constructor notifies the io_context that work is starting. More...
 
 ~work ()
 Destructor notifies the io_context that the work is complete. More...
 
asio::io_contextget_io_context ()
 Get the io_context associated with the work.
 

Detailed Description

(Deprecated: Use executor_work_guard.) Class to inform the io_context when it has work to do.

The work class is used to inform the io_context when work starts and finishes. This ensures that the io_context object's run() function will not exit while work is underway, and that it does exit when there is no unfinished work remaining.

The work class is copy-constructible so that it may be used as a data member in a handler class. It is not assignable.

Constructor & Destructor Documentation

◆ work() [1/2]

asio::io_context::work::work ( asio::io_context io_context)
inlineexplicit

Constructor notifies the io_context that work is starting.

The constructor is used to inform the io_context that some work has begun. This ensures that the io_context object's run() function will not exit while the work is underway.

◆ work() [2/2]

asio::io_context::work::work ( const work other)
inline

Copy constructor notifies the io_context that work is starting.

The constructor is used to inform the io_context that some work has begun. This ensures that the io_context object's run() function will not exit while the work is underway.

◆ ~work()

asio::io_context::work::~work ( )
inline

Destructor notifies the io_context that the work is complete.

The destructor is used to inform the io_context that some work has finished. Once the count of unfinished work reaches zero, the io_context object's run() function is permitted to exit.


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