asio::io_service::work Class Reference

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

#include <io_service.hpp>

List of all members.

Public Member Functions

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

Private Member Functions

void operator= (const work &other)

Private Attributes

asio::io_serviceio_service_


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'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.

Definition at line 360 of file io_service.hpp.


Constructor & Destructor Documentation

asio::io_service::work::work ( asio::io_service io_service  )  [inline, 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's run() function will not exit while the work is underway.

Definition at line 138 of file io_service.ipp.

References asio::io_service::impl_, io_service_, and asio::detail::task_io_service< Task >::work_started().

asio::io_service::work::work ( const work other  )  [inline]

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's run() function will not exit while the work is underway.

Definition at line 144 of file io_service.ipp.

References asio::io_service::impl_, io_service_, and asio::detail::task_io_service< Task >::work_started().

asio::io_service::work::~work (  )  [inline]

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's run() function is permitted to exit.

Definition at line 150 of file io_service.ipp.

References asio::io_service::impl_, io_service_, and asio::detail::task_io_service< Task >::work_finished().


Member Function Documentation

asio::io_service & asio::io_service::work::io_service (  )  [inline]

Get the io_service associated with the work.

Definition at line 155 of file io_service.ipp.

References io_service_.

void asio::io_service::work::operator= ( const work other  )  [private]


Member Data Documentation

Definition at line 395 of file io_service.hpp.

Referenced by io_service(), work(), and ~work().


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

Generated on Sun May 25 00:21:29 2008 by  doxygen 1.5.6