2 / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 [section:Service Service requirements]
10 A class is a service if it is publicly derived from another service, or if it
11 is a class derived from `io_service::service` and contains a
12 publicly-accessible declaration as follows:
14 static io_service::id id;
16 All services define a one-argument constructor that takes a reference to the
17 `io_service` object that owns the service. This constructor is /explicit/,
18 preventing its participation in automatic conversions. For example:
20 class my_service : public io_service::service
23 static io_service::id id;
24 explicit my_service(io_service& ios);
26 virtual void shutdown_service();
30 A service's `shutdown_service` member function must cause all copies of
31 user-defined handler objects that are held by the service to be destroyed.