Kea 1.5.0
io_service.h
Go to the documentation of this file.
1// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ASIOLINK_IO_SERVICE_H
8#define ASIOLINK_IO_SERVICE_H 1
9
10#include <boost/function.hpp>
11
12namespace boost {
13namespace asio {
14#if BOOST_VERSION < 106600
15 class io_service;
16#else
17 class io_context;
18 typedef io_context io_service;
19#endif
20}
21}
22
23namespace isc {
24namespace asiolink {
25
26class IOServiceImpl;
27
31class IOService {
37
38private:
39 IOService(const IOService& source);
40 IOService& operator=(const IOService& source);
41public:
43 IOService();
45 ~IOService();
47
52 void run();
53
59 void run_one();
60
65 void poll();
66
70 void stop();
71
74 void stopWork();
75
82 boost::asio::io_service& get_io_service();
83
93 void post(const boost::function<void ()>& callback);
94
95private:
96 IOServiceImpl* io_impl_;
97};
98
100typedef boost::shared_ptr<IOService> IOServicePtr;
101
102} // namespace asiolink
103} // namespace isc
104#endif // ASIOLINK_IO_SERVICE_H
Defines the logger used by the top-level component of kea-dhcp-ddns.