notify_io_service.hpp
Go to the documentation of this file.
1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3 // Copyright (c) 2009 Boris Schaeling
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 #pragma once
11 
12 #include <boost/process/config.hpp>
14 
16 {
17 
18  template <class IOService>
20  {
21  public:
22  explicit notify_io_service_(IOService& io_service) :
23  io_service_(io_service) {}
24 
25  template <class PosixExecutor>
26  void on_fork_setup(PosixExecutor&) const
27  {
28  io_service_.notify_fork(IOService::fork_prepare);
29  }
30 
31  template <class PosixExecutor>
32  void on_fork_success(PosixExecutor&) const
33  {
34  io_service_.notify_fork(IOService::fork_parent);
35  }
36 
37  template <class PosixExecutor>
38  void on_exec_setup(PosixExecutor&) const
39  {
40  io_service_.notify_fork(IOService::fork_child);
41  }
42 
43  private:
44  IOService& io_service_;
45  };
46 
47  template <class IOService>
49  {
50  return notify_io_service_<IOService>(io_service);
51  }
52 
53 }
boost::process::posix::initializers::notify_io_service_
Definition: notify_io_service.hpp:19
boost::process::posix::initializers::notify_io_service_::notify_io_service_
notify_io_service_(IOService &io_service)
Definition: notify_io_service.hpp:22
config.hpp
initializer_base.hpp
boost::process::posix::initializers::notify_io_service_::on_fork_setup
void on_fork_setup(PosixExecutor &) const
Definition: notify_io_service.hpp:26
boost::process::posix::initializers
Definition: bind_fd.hpp:15
boost::process::posix::initializers::notify_io_service
notify_io_service_< IOService > notify_io_service(IOService &io_service)
Definition: notify_io_service.hpp:48
boost::process::posix::initializers::initializer_base
Definition: initializer_base.hpp:15
boost::process::posix::initializers::notify_io_service_::on_exec_setup
void on_exec_setup(PosixExecutor &) const
Definition: notify_io_service.hpp:38
boost::process::posix::initializers::notify_io_service_::on_fork_success
void on_fork_success(PosixExecutor &) const
Definition: notify_io_service.hpp:32