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 
12 namespace boost {
13 namespace 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 
23 namespace isc {
24 namespace asiolink {
25 
26 class IOServiceImpl;
27 
31 class IOService {
37 
38 private:
39  IOService(const IOService& source);
40  IOService& operator=(const IOService& source);
41 public:
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 
95 private:
96  IOServiceImpl* io_impl_;
97 };
98 
100 typedef boost::shared_ptr<IOService> IOServicePtr;
101 
102 } // namespace asiolink
103 } // namespace isc
104 #endif // ASIOLINK_IO_SERVICE_H
boost
Definition: io_service.h:12
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144