]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | // Copyright (c) 2016 Klemens D. Morgenstern |
2 | // | |
3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | ||
6 | #ifndef BOOST_PROCESS_POSIX_ON_EXIT_HPP_ | |
7 | #define BOOST_PROCESS_POSIX_ON_EXIT_HPP_ | |
8 | ||
9 | #include <boost/process/detail/config.hpp> | |
10 | #include <boost/process/detail/handler_base.hpp> | |
11 | #include <boost/process/detail/posix/async_handler.hpp> | |
12 | #include <system_error> | |
13 | #include <functional> | |
14 | ||
15 | namespace boost { namespace process { namespace detail { namespace posix { | |
16 | ||
17 | struct on_exit_ : boost::process::detail::posix::async_handler | |
18 | { | |
19 | std::function<void(int, const std::error_code&)> handler; | |
20 | on_exit_(const std::function<void(int, const std::error_code&)> & handler) : handler(handler) | |
21 | { | |
22 | ||
23 | } | |
24 | ||
25 | template<typename Executor> | |
26 | std::function<void(int, const std::error_code&)> on_exit_handler(Executor&) | |
27 | { | |
28 | return handler; | |
29 | ||
92f5a8d4 | 30 | } |
b32b8144 FG |
31 | }; |
32 | ||
33 | ||
34 | }}}} | |
35 | #endif /* BOOST_PROCESS_POSIX_ON_EXIT_HPP_ */ |