Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:09

0001 // Copyright (c) 2016 Klemens D. Morgenstern
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 
0007 #ifndef BOOST_PROCESS_DETAIL_HANDLER_HPP_
0008 #define BOOST_PROCESS_DETAIL_HANDLER_HPP_
0009 
0010 #include <boost/process/detail/config.hpp>
0011 
0012 #if defined(BOOST_POSIX_API)
0013 #include <boost/process/detail/posix/handler.hpp>
0014 #elif defined(BOOST_WINDOWS_API)
0015 #include <boost/process/detail/windows/handler.hpp>
0016 #endif
0017 
0018 
0019 namespace boost { namespace process { namespace detail {
0020 
0021 //extended handler base.
0022 typedef api::handler_base_ext handler;
0023 
0024 
0025 template <class Handler>
0026 struct on_setup_ : handler
0027 {
0028     explicit on_setup_(Handler handler) : handler_(handler) {}
0029 
0030     template <class Executor>
0031     void on_setup(Executor &e)
0032     {
0033         handler_(e);
0034     }
0035 private:
0036     Handler handler_;
0037 };
0038 
0039 template <class Handler>
0040 struct on_error_ : handler
0041 {
0042     explicit on_error_(Handler handler) : handler_(handler) {}
0043 
0044     template <class Executor>
0045     void on_error(Executor &e, const std::error_code &ec)
0046     {
0047         handler_(e, ec);
0048     }
0049 private:
0050     Handler handler_;
0051 };
0052 
0053 template <class Handler>
0054 struct on_success_ : handler
0055 {
0056     explicit on_success_(Handler handler) : handler_(handler) {}
0057 
0058     template <class Executor>
0059     void on_success(Executor &e)
0060     {
0061         handler_(e);
0062     }
0063 private:
0064     Handler handler_;
0065 };
0066 
0067 }
0068 
0069 
0070 
0071 }}
0072 
0073 
0074 
0075 #endif /* BOOST_PROCESS_DETAIL_HANDLER_HPP_ */