ian@0: // ian@0: // Boost.Process ian@0: // ~~~~~~~~~~~~~ ian@0: // ian@0: // Copyright (c) 2006, 2007 Julio M. Merino Vidal ian@0: // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling ian@0: // Copyright (c) 2009 Boris Schaeling ian@0: // Copyright (c) 2010 Felipe Tanus, Boris Schaeling ian@0: // ian@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying ian@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ian@0: // ian@0: ian@0: /** ian@0: * \file boost/process/detail/basic_status.hpp ian@0: * ian@0: * Includes the declaration of the basic status class. ian@0: */ ian@0: ian@0: #ifndef BOOST_PROCESS_DETAIL_BASIC_STATUS_HPP ian@0: #define BOOST_PROCESS_DETAIL_BASIC_STATUS_HPP ian@0: ian@0: #include ian@0: #include ian@0: #include ian@0: ian@0: namespace boost { ian@0: namespace process { ian@0: namespace detail { ian@0: ian@0: /** ian@0: * The basic_status class to wait for processes to exit. ian@0: * ian@0: * The basic_status class is a Boost.Asio I/O object and supports synchronous ian@0: * and asynchronous wait operations. It must be instantiated with a Service. ian@0: */ ian@0: template ian@0: class basic_status ian@0: : public boost::asio::basic_io_object ian@0: { ian@0: public: ian@0: explicit basic_status(boost::asio::io_service &io_service) ian@0: : boost::asio::basic_io_object(io_service) ian@0: { ian@0: } ian@0: ian@0: /** ian@0: * Waits synchronously for a process to exit. ian@0: */ ian@0: int wait(pid_type pid) ian@0: { ian@0: return this->service.wait(this->implementation, pid); ian@0: } ian@0: ian@0: /** ian@0: * Waits asynchronously for a process to exit. ian@0: */ ian@0: template ian@0: void async_wait(pid_type pid, Handler handler) ian@0: { ian@0: this->service.async_wait(this->implementation, pid, handler); ian@0: } ian@0: }; ian@0: ian@0: } ian@0: } ian@0: } ian@0: ian@0: #endif