Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::io_service::work Class Reference

Class to inform the io_service when it has work to do. More...

#include <io_service.hpp>

Public Member Functions

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

Detailed Description

Class to inform the io_service when it has work to do.

The work class is used to inform the io_service when work starts and finishes. This ensures that the io_service 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

boost::asio::io_service::work::work ( boost::asio::io_service io_service)
explicit

Constructor notifies the io_service that work is starting.

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

boost::asio::io_service::work::work ( const work other)

Copy constructor notifies the io_service that work is starting.

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

boost::asio::io_service::work::~work ( )

Destructor notifies the io_service that the work is complete.

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

Member Function Documentation

boost::asio::io_service& boost::asio::io_service::work::get_io_service ( )

Get the io_service associated with the work.


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