Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54333 - in sandbox/async/libs/async/doc/reference: . typeof
From: vicente.botet_at_[hidden]
Date: 2009-06-25 11:06:58


Author: viboes
Date: 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
New Revision: 54333
URL: http://svn.boost.org/trac/boost/changeset/54333

Log:
Boost.Async V0.3: Adding reference doc
Added:
   sandbox/async/libs/async/doc/reference/
   sandbox/async/libs/async/doc/reference/act_traits.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/algorithm.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/are_all_joinable.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/are_all_ready.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/asynchronous_adapter.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/asynchronous_executor_decorator.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/basic_threader.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/basic_threader_decorator.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/detach.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/detach_all.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/fork.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/fork_after.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/fork_all.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/future_traits.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/launcher.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/launcher_decorator.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/scheduler.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/threader.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/typeof/
   sandbox/async/libs/async/doc/reference/typeof/basic_threader.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/typeof/futures.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/typeof/launcher.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/typeof/scheduler.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/typeof/threader.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait_all.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait_all_until.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait_for_all.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait_for_any.qbk (contents, props changed)
   sandbox/async/libs/async/doc/reference/wait_until.qbk (contents, props changed)

Added: sandbox/async/libs/async/doc/reference/act_traits.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/act_traits.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,39 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:act_traits_hpp Header `<boost/async/act_traits.hpp>`]
+[/==========================================================================================]
+
+Includes all the __ACT__ and __AE__ traits.
+
+ namespace boost {
+ namespace async {
+
+ template<typename ACT>
+ struct act_traits;
+
+ template <typename ACT>
+ struct is_movable;
+
+ template <typename ACT>
+ struct has_future_if;
+
+ template <typename ACT>
+ struct has_thread_if;
+
+ template <typename AE, typename T>
+ struct asynchronous_completion_token;
+
+ template <typename AE>
+ struct get_future;
+
+ }
+ }
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/algorithm.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/algorithm.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,57 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:algorithm_hpp Header `<boost/async/algorithm.hpp>`]
+[/==========================================================================================]
+
+Include all the __AE__/__ACT__ framework functions.
+
+ #include <boost/async/fork.hpp>
+ //#include <boost/async/lazy_fork.hpp>
+ #include <boost/async/fork_after.hpp>
+ #include <boost/async/fork_all.hpp>
+ #include <boost/async/wait_for_all.hpp>
+ #include <boost/async/wait_for_any.hpp>
+
+ #include <boost/async/algorithm/join.hpp>
+ #include <boost/async/algorithm/join_until.hpp>
+ //#include <boost/async/algorithm/join_all_for.hpp>
+ #include <boost/async/algorithm/joinable.hpp>
+ #include <boost/async/algorithm/detach.hpp>
+ #include <boost/async/algorithm/interrupt.hpp>
+ #include <boost/async/algorithm/interruption_requested.hpp>
+
+ #include <boost/async/algorithm/join_all.hpp>
+ #include <boost/async/algorithm/join_all_until.hpp>
+ //#include <boost/async/algorithm/join_all_for.hpp>
+ #include <boost/async/algorithm/are_all_joinable.hpp>
+ #include <boost/async/algorithm/detach_all.hpp>
+ #include <boost/async/algorithm/interrupt_all.hpp>
+ #include <boost/async/algorithm/interruption_requested_on_all.hpp>
+
+ #include <boost/async/algorithm/wait.hpp>
+ #include <boost/async/algorithm/wait_until.hpp>
+ //#include <boost/async/algorithm/wait_all_for.hpp>
+ #include <boost/async/algorithm/get.hpp>
+ #include <boost/async/algorithm/get_until.hpp>
+ #include <boost/async/algorithm/is_ready.hpp>
+ #include <boost/async/algorithm/has_value.hpp>
+ #include <boost/async/algorithm/has_exception.hpp>
+
+ #include <boost/async/algorithm/wait_all.hpp>
+ #include <boost/async/algorithm/wait_all_until.hpp>
+ //#include <boost/async/algorithm/wait_all_for.hpp>
+ #include <boost/async/algorithm/get_all.hpp>
+ //#include <boost/async/algorithm/get_all_until.hpp>
+ //#include <boost/async/algorithm/get_all_for.hpp>
+ #include <boost/async/algorithm/are_all_ready.hpp>
+ #include <boost/async/algorithm/have_all_value.hpp>
+ #include <boost/async/algorithm/have_all_exception.hpp>
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/are_all_joinable.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/are_all_joinable.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,36 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:are_all_joinable_hpp Header `<boost/async/algorithm/are_all_joinable.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __are_all_joinable__ which states if all the __ACT__ in a sequence of __ACT__ are __joinable__.
+
+ namespace boost { namespace async {
+ namespace fct {
+ struct joinable {
+ typedef bool result_type;
+
+ template<typename ACT>
+ bool operator()(ACT& act) const;
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence>
+ struct are_all_joinable {
+ typedef typename fusion::result_of::all<Sequence, fct::joinable>::type type;
+ };
+ }
+
+ template <typename Sequence>
+ bool are_all_joinable(Sequence& t);
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/are_all_ready.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/are_all_ready.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,33 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:are_all_ready_hpp Header `<boost/async/algorithm/are_all_ready.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __are_all_ready__ which states if all the __ACT__ in a sequence of __ACT__ are ready.
+The current implementation applies the __is_ready__ free function for each __ACT__.
+
+ namespace boost { namespace async {
+ namespace fct {
+ struct is_ready {
+ typedef bool result_type;
+ template<typename ACT> bool operator()(ACT& act) const;
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence> struct are_all_ready {
+ typedef typename fusion::result_of::template all<Sequence, fct::is_ready>::type type;
+ };
+ }
+
+ template <typename Sequence> bool are_all_ready(Sequence& t);
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/asynchronous_adapter.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/asynchronous_adapter.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,53 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+
+[/==========================================================================================]
+[section:asynchronous_adapter_hpp Header `<boost/async/asynchronous_adapter.hpp>`]
+[/==========================================================================================]
+
+ namespace boost { namespace async {
+ template <typename AE, template <class> class Decorator>
+ struct asynchronous_executor_decorator : AE {
+ template <typename T>
+ struct handle {
+ typedef typename AE::template handle<T>::type type;
+ };
+
+ template <typename F>
+ typename AE::template handle< typename boost::result_of<F()>::type >::type
+ fork( F fn );
+
+ asynchronous_executor_decorator();
+
+ template <typename Nullary>
+ asynchronous_executor_decorator(thread::native_handle_attr_type& attr, Nullary f);
+ asynchronous_executor_decorator(Nullary f);
+
+ asynchronous_executor_decorator(boost::detail::thread_move_t<asynchronous_executor_decorator> x);
+
+ asynchronous_executor_decorator& operator=(boost::detail::thread_move_t<asynchronous_executor_decorator> x);
+
+ operator boost::detail::thread_move_t<asynchronous_executor_decorator>();
+
+ boost::detail::thread_move_t<asynchronous_executor_decorator> move();
+ };
+
+ template <typename AE, template <class> class Decorator>
+ struct get_future<asynchronous_executor_decorator<AE, Decorator> > {
+ template <typename T>
+ struct future_type {
+ typedef typename AE::template get_future<AE>::type type;
+ };
+ template <typename T>
+ typename future_type<T>::type& operator()(typename AE::template handle<T>::type & j);
+ };
+ }}
+
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/asynchronous_executor_decorator.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/asynchronous_executor_decorator.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,36 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:asynchronous_executor_decorator_hpp Header `<boost/async/asynchronous_executor_decorator.hpp>`]
+[/==========================================================================================]
+
+ namespace boost { namespace async {
+ template <typename AE, template <class> class Decorator>
+ struct asynchronous_executor_decorator : AE {
+ template <typename T> struct handle {
+ typedef typename AE::template handle<T>::type type;
+ };
+
+ template <typename F>
+ typename AE::template handle< typename boost::result_of<F()>::type >::type
+ fork( F fn );
+ };
+
+ template <typename AE, template <class> class Decorator>
+ struct get_future<asynchronous_executor_decorator<AE, Decorator> > {
+ template <typename T>
+ struct future_type {
+ typedef typename AE::template get_future<AE>::type type;
+ };
+ template <typename T>
+ typename future_type<T>::type& operator()(typename AE::template handle<T>::type & j);
+ };
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/basic_threader.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/basic_threader.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,69 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:basic_threader_hpp Header `<boost/async/basic_threader.hpp>`]
+[/==========================================================================================]
+
+__basic_threader__ is an __AE__ with a thread as __ThreadBasedACT__.
+
+ namespace boost { namespace async {
+ class basic_threader {
+ public:
+ thread::native_handle_attr_type& attr();
+
+ template <typename T> struct handle {
+ typedef thread type;
+ };
+
+ template <typename F> thread fork(F f);
+ };
+
+ template<>
+ struct act_traits<thread > {
+ typedef void move_dest_type;
+ };
+
+ namespace partial_specialization_workaround {
+ template <>
+ struct wait<thread> {
+ static result_of::wait<thread>::type apply( thread& act) {
+ return act.join();
+ }
+ };
+
+ template <>
+ struct wait_until<thread> {
+ static result_of::wait_until<thread>::type apply( thread& act, const system_time& abs_time ) {
+ return act.timed_join(abs_time);
+ }
+ };
+ template <typename Duration>
+ struct wait_for<thread, Duration> {
+ static typename result_of::template wait_for<thread,Duration>::type apply( thread& act, Duration abs_time ) {
+ return act.timed_join(abs_time);
+ }
+ };
+
+ template <>
+ struct join_until<thread> {
+ static result_of::join_until<thread>::type apply( thread& act, const system_time& abs_time ) {
+ return act.timed_join(abs_time);
+ }
+ };
+ template <typename Duration>
+ struct join_for<thread, Duration> {
+ static typename result_of::template join_for<thread,Duration>::type apply( thread& act, Duration abs_time ) {
+ return act.timed_join(abs_time);
+ }
+ };
+ }
+
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/basic_threader_decorator.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/basic_threader_decorator.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,19 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:basic_threader_decorator_hpp Header `<boost/async/basic_threader_decorator.hpp>`]
+[/==========================================================================================]
+
+Shorter name for an __asynchronous_executor_decorator__ based on __basic_threader__ and decorated with the __thread_decorator__ .
+
+ namespace boost { namespace async {
+ typedef asynchronous_executor_decorator<basic_threader,thread_decorator> basic_threader_decorator;
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/detach.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/detach.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,41 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:detach_hpp Header `<boost/async/algorithm/detach.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __detach__ which __detach__ the __ACT__ passed as parameter.
+The default implementation applies the __detach__ member function to the __ACT__. A user adapting another __ACT__ could need
+to specialize the __detach__ free function if the __ACT__ do not provides a detach function with the same prototype.
+
+As for the moment we can not partially specialize a function a trick is used: instead of calling directly to the __detach__
+member function detach calls to the static operation apply on a class with the same name in the namespace __partial_specialization_workaround__.
+So the user can specialize partially this class.
+
+The template parameter ACT must be a model of __ThreadBasedACT__.
+
+ namespace boost { namespace async {
+ namespace result_of {
+ template <typename ACT> struct detach {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct detach {
+ static typename result_of::detach<ACT>::type apply( ACT& act );
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,void>::type
+ detach(ACT& act);
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/detach_all.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/detach_all.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,35 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:detach_all_hpp Header `<boost/async/algorithm/detach_all.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __detach_all__ which detach all the __ACT__ in the sequence passed as parameter.
+
+ namespace boost { namespace async {
+ namespace fct {
+ struct detach {
+ typedef void result_type;
+ template<typename ACT>
+ void operator()(ACT& act) const;
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence>
+ struct detach_all {
+ typedef typename fusion::result_of::for_each<Sequence, fct::detach>::type type;
+ };
+ }
+
+ template <typename Sequence>
+ void detach_all(Sequence& t);
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/fork.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/fork.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,118 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:fork_hpp Header `<boost/async/fork.hpp>`]
+[/==========================================================================================]
+
+ namespace boost { namespace async {
+ namespace result_of {
+ template <typename AE, typename F, typename A1, ..., typename An>
+ struct fork;
+ typedef typename AE::handle<typename result_of<F(A1, ..., An)> >::type type;
+ };
+ }
+
+ template< typename AE, typename F, typename A1, ..., typename An >
+ typename asynchronous_completion_token<AE,
+ typename boost::result_of<F(A1,..., An)>::type >::type
+ fork( AE& ae, F fn, A1 a1, ..., An an );
+
+
+ template< typename F, typename A1, ..., typename An >
+ typename asynchronous_completion_token<default_asynchronous_executor,
+ typename boost::result_of<F(A1,..., An)>::type >::type
+ fork( F fn, A1 a1, ..., An an );
+ }}
+
+[section Metafunction `result_of::fork<AE,F> `]
+[/==========================================================================================]
+
+A metafunction returning the result type of applying __fork__ to an asynchronous executor and a Nullary functor.
+
+ namespace result_of {
+ template <typename AE, typename F, typename A1, ..., typename An>
+ struct fork;
+ typedef typename AE::handle<typename result_of<F(A1, ..., An)> >::type type;
+ };
+ }
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of __AsynchronousExecutor__]
+ [Operation's argument ]
+ ]
+ [
+ [`F`]
+ [A model of n-ary function]
+ [Operation's argument ]
+ ]
+ [
+ [`Ak`]
+ [A model of n-ary function]
+ [n-ary function argument type for argument k]
+ ]
+]
+
+[variablelist
+[[Expression:] [result_of::fork<AE,F,A1,...,An>::type]]
+[[Return type:] [AE::handle<typename result_of<F(A1,...,An)> >::type]]
+]
+
+[endsect]
+
+[section Non member function `fork()`]
+[/==========================================================================================]
+
+ template< typename AE, typename F, typename A1 , ... typename An >
+ typename result_of::fork<AE,F, A1, An> >::type> >::type
+ fork( AE& ae, F fn, A1 a1 , ..., An an );
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of __AsynchronousExecutor__]
+ [Operation's argument ]
+ ]
+ [
+ [`F`]
+ [A model of n-ary function]
+ [Operation's argument ]
+ ]
+ [
+ [`Ak`]
+ [A model of n-ary function]
+ [n-ary function argument type for argument k]
+ ]
+]
+
+[variablelist
+[[Requires:] [The expression fn(a1, ..., an) must be valid and
+have a type convertible to R, where R is typename result_of<F(A1, ..., An)>::type..]]
+
+[[Efect:] [Request the `AE` to creates a thread of execution for the function `fn`
+Request the asynchronous evaluation the expression `fn(a1, ..., an)` with respect to the calling thread to the
+asynchronous executor `ae` and
+places its result in an object h of type AE::handle<R>::type as if by using h.set_value( fn(a1, ..., an) ).
+If the expression fn() throws an exception e, places e into h as if by using
+h.set_exception( current_exception() ).]]
+
+[[Returns:] [the AE handle h.]]
+]
+[endsect]
+[endsect]

Added: sandbox/async/libs/async/doc/reference/fork_after.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/fork_after.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,265 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:fork_after_hpp Header `<boost/async/fork_after.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __fork_after__ which request the asynchronous evaluation a function with respect to
+the calling thread to the asynchronous executor `ae` after the completion of some __ACT__. The result is an __ACT__ wrapping the __ACT__ associated to the __AE__.
+
+The default implementation forks a helper task which waits the completion of the __ACT__ 's only then evaluates the function.
+A user adapting another __AE__ could want to specialize the __fork_after__ free function.
+As for the moment we can not partially specialize a function a trick is used: instead of calling directly to the __fork_after__
+member function __fork_after__ calls to the static operation __apply__ on a class with the same name in the namespace __partial_specialization_workaround__.
+So the user can specialize partially this class.
+
+ namespace boost { namespace async {
+ template <typename ACT>
+ struct act_traits<act_wrapper<ACT> >;
+
+ template <typename ACT>
+ struct is_movable<act_wrapper<ACT> > : is_movable<ACT>{};
+
+ template <typename ACT>
+ struct has_future_if<act_wrapper<ACT> > : has_future_if<ACT> {};
+
+ template <typename ACT>
+ struct has_thread_if<act_wrapper<ACT> > : has_thread_if<ACT>{};
+
+ template <typename ACT>
+ struct act_wrapper;
+
+ namespace result_of {
+ template <typename AE,typename F>
+ struct fork_after {
+ typedef act_wrapper<typename asynchronous_completion_token<AE, typename boost::result_of<F()>::type>::type> type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename AE, typename F, typename D >
+ struct fork_after {
+ static typename result_of::fork_after<AE,F>::type
+ apply(AE& ae, F fn, D& d);
+ };
+ }
+
+ template< typename AE, typename F, typename D>
+ typename result_of::fork_after<AE,F>::type
+ fork_after( AE& ae, F fn, D& d);
+
+ template< typename AE, typename D, typename F, typename A1, ..., typename An >
+ act_wrapper< typename asynchronous_completion_token<AE, typename boost::result_of<F(A1,..., An)>::type >::type >
+ after_completion_fork( AE& ae, D& d, F fn, A1 a1, ..., An an );
+
+
+ }}
+
+[/==================================================]
+[section Partial Specialization Template Class `act_traits<act_wrapper<ACT>>`]
+[/==========================================================================================]
+
+act_wrapper inherits the traits of its wrapped __ACT__.
+
+ template <typename ACT>
+ struct act_traits<act_wrapper<ACT> > : act_traits<ACT>{};
+
+[endsect]
+
+[/==================================================]
+[section Partial Specialization Template Class `is_movable<act_wrapper<ACT> >`]
+[/==========================================================================================]
+
+act_wrapper inherits the traits of its wrapped __ACT__.
+
+ template <typename ACT>
+ struct is_movable<act_wrapper<ACT> > : is_movable<ACT>{};
+
+[endsect]
+
+[/==================================================]
+[section Template Class `act_wrapper<>`]
+[/==========================================================================================]
+
+ template <typename ACT>
+ struct act_wrapper {
+ typedef typename act_traits<act_wrapper<ACT> >::move_dest_type move_dest_type;
+ act_wrapper();
+ void wait_initialized();
+ void set(ACT& other);
+ void set(boost::detail::thread_move_t<ACT> other);
+
+ void wait();
+ bool wait_until(const system_time& abs_time);
+ template <typename Duration>
+ bool wait_for(ACT& act, Duration rel_time);
+ move_dest_type get();
+ bool is_ready();
+ bool has_value();
+ bool has_exception();
+
+ void detach();
+ bool joinable();
+ void join();
+ bool join_until(const system_time& abs_time);
+ template <typename Duration>
+ bool join_for(ACT& act, Duration rel_time);
+ void interrupt();
+ bool interruption_requested();
+ };
+
+
+[endsect]
+
+[section Metafunction `result_of::fork<AE,F> `]
+[/==========================================================================================]
+
+A metafunction returning the result type of applying __fork_after__ to an asynchronous executor and a Nullary functor.
+
+ namespace result_of {
+ template <typename AE,typename F>
+ struct fork_after {
+ typedef act_wrapper<typename asynchronous_completion_token<AE, typename boost::result_of<F()>::type>::type> type;
+ };
+ }
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of __AsynchronousExecutor__]
+ [Operation's argument ]
+ ]
+ [
+ [`F`]
+ [A model of n-ary function]
+ [Operation's argument ]
+ ]
+]
+
+[variablelist
+[[Expression:] [result_of::fork_after<AE,F>::type]]
+[[Return type:] [act_wrapper<typename asynchronous_completion_token<AE, typename boost::result_of<F()>::type>::type>]]
+]
+
+[endsect]
+
+[section Static Member Function `partial_specialization_workaround::fork_after<>::apply()`]
+[/==========================================================================================]
+
+ namespace partial_specialization_workaround {
+ template< typename AE, typename F, typename D >
+ struct fork_after {
+ static typename result_of::fork_after<AE,F>::type
+ apply(AE& ae, F fn, D& d);
+ };
+ }
+
+[endsect]
+
+[section Non member function `fork_after()`]
+[/==========================================================================================]
+
+ template< typename AE, typename F, typename D>
+ typename result_of::fork_after<AE,F,D>::type
+ fork_after( AE& ae, F fn, D& d);
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of __AsynchronousExecutor__]
+ [Operation's argument ]
+ ]
+ [
+ [`F`]
+ [A model of n-ary function]
+ [Operation's argument ]
+ ]
+ [
+ [`D`]
+ [A model of a fusion __Sequence__ of __ACT__]
+ [Dependent __ACT__ ]
+ ]
+]
+
+[variablelist
+[[Requires:] [The expression fn() must be valid and
+have a type convertible to R, where R is typename result_of<F()>::type..]]
+
+[[Efect:] [Request the asynchronous evaluation the expression `fn()` with respect to the calling thread to the
+asynchronous executor `ae` after the completion of all the __ACT__ in `d` and
+places its result in an object h of type AE::handle<R>::type as if by using h.set_value( fn() ).
+If the expression fn() throws an exception e, places e into h as if by using
+h.set_exception( current_exception() ).]]
+
+[[Returns:] [the AE handle h.]]
+]
+
+[endsect]
+
+[section Non member function `after_completion_fork()`]
+[/==========================================================================================]
+
+ template< typename AE, typename D, typename F, typename A1, ..., typename An >
+ act_wrapper< typename asynchronous_completion_token<AE, typename boost::result_of<F(A1,..., An)>::type >::type >
+ after_completion_fork( AE& ae, D& d, F fn, A1 a1, ..., An an );
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of __AsynchronousExecutor__]
+ [Operation's argument ]
+ ]
+ [
+ [`D`]
+ [A model of a fusion __Sequence__ of __ACT__]
+ [Dependent __ACT__ ]
+ ]
+ [
+ [`F`]
+ [A model of n-ary function]
+ [Operation's argument ]
+ ]
+ [
+ [`Ak`]
+ [A model of n-ary function]
+ [n-ary function argument type for argument k]
+ ]
+]
+
+[variablelist
+[[Requires:] [The expression fn(a1, ..., an) must be valid and
+have a type convertible to R, where R is typename result_of<Fn()>::type..]]
+
+[[Efect:] [Request the `AE` to creates a thread of execution for the function `fn`
+Request the asynchronous evaluation the expression `fn(a1, ..., an)` with respect to the calling thread to the
+asynchronous executor `ae` after the completion of all the __ACT__ in `d` and
+places its result in an object h of type AE::handle<R>::type as if by using h.set_value( fn(a1, ..., an) ).
+If the expression fn() throws an exception e, places e into h as if by using
+h.set_exception( current_exception() ).]]
+
+[[Returns:] [the AE handle h.]]
+]
+
+[endsect]
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/fork_all.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/fork_all.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,117 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:fork_all_hpp Header `<boost/async/fork_all.hpp>`]
+[/==========================================================================================]
+
+ namespace boost { namespace async {
+ namespace result_of {
+ template <typename AE, typename T>
+ struct fork_all;
+ template <typename AE, typename F1, ..., typename Fn>
+ struct fork_all <AE,fusion::tuple<F1, ..., Fn> >{
+ typedef fusion::tuple<
+ typename result_of::fork<AE,F1>::type,
+ ...
+ typename result_of::fork<AE,Fn>::type
+ > type;
+ };
+ }
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::fork_all<AE, mpl::tuple<F1, ..., Fn> >::type
+ fork_all( AE& ae, F1 f1, ..., Fn fn );
+
+ template< typename F1, ..., typename Fn>
+ typename result_of::fork_all<default_asynchronous_executor, F1, ..., Fn>::type
+ fork_all( F1 f1, ..., Fn fn );
+ }}
+
+[section Metafunction `result_of::fork_all<AE,F1, ..., Fn> `]
+[/==========================================================================================]
+
+A metafunction returning the result type of applying fork_all to an asynchronous executor and n Nullary functors.
+
+ namespace result_of {
+ template <typename AE, typename T>
+ struct fork_all;
+ template <typename AE, typename F1, ..., typename Fn>
+ struct fork_all <AE,fusion::tuple<F1, ..., Fn> >{
+ typedef fusion::tuple<
+ typename result_of::fork<AE,F1>::type,
+ ...
+ typename result_of::fork<AE,Fn>::type
+ > type;
+ };
+ }
+
+[table fork_all Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of `AsynchrousExecutor`]
+ [Operation's argument ]
+ ]
+ [
+ [`Fk`]
+ [A model of nullary function]
+ [Operation's argument ]
+ ]
+]
+
+[variablelist
+[[Expression:] [`result_of::fork_all<AE,F1,...,Fn>::type`]]
+[[Return type:] [a fusion tuple of the result of forking each `Fk` by the `AE`]]
+]
+
+[endsect]
+
+[section Non member function `fork_all()`]
+[/==========================================================================================]
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::fork_all<AE, mpl::tuple<F1, ..., Fn> >::type
+ fork_all( AE& ae, F1 f1, ..., Fn fn );
+
+ template< typename F1, ..., typename Fn>
+ typename result_of::fork_all<default_asynchronous_executor, F1, ..., Fn>::type
+ fork_all( F1 f1, ..., Fn fn );
+
+[table fork Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of `AsynchrousExecutor`]
+ [Operation's argument ]
+ ]
+ [
+ [`Fk`]
+ [A model of nullary function]
+ [Operation's argument ]
+ ]
+]
+
+[variablelist
+[[Returns:] [a fusion tuple of the result of forking each `fk` by the `ae`]]
+[[Efect:] [Request the `AE` to creates a n thread of execution one for the function `fk`.]]
+]
+
+[endsect]
+
+
+[endsect]
+
+

Added: sandbox/async/libs/async/doc/reference/future_traits.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/future_traits.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,149 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:future_traits_hpp Header `<boost/async/future_traits.hpp>`]
+[/==========================================================================================]
+
+
+ namespace boost { namespace async {
+
+ template<typename T>
+ struct act_traits<unique_future<T> >
+ {
+ #ifdef BOOST_HAS_RVALUE_REFS
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,T&&>::type move_dest_type;
+ #else
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T>::type move_dest_type;
+ #endif
+ };
+
+ template<typename T>
+ struct act_traits<unique_future<T&> >
+ {
+ typedef T& move_dest_type;
+ };
+
+ template<>
+ struct act_traits<unique_future<void> >
+ {
+ typedef void move_dest_type;
+ };
+
+ template<typename T>
+ struct act_traits<shared_future<T> >
+ {
+ #ifdef BOOST_HAS_RVALUE_REFS
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,T&&>::type move_dest_type;
+ #else
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T>::type move_dest_type;
+ #endif
+ };
+
+ template<typename T>
+ struct act_traits<shared_future<T&> >
+ {
+ typedef T& move_dest_type;
+ };
+
+ template<>
+ struct act_traits<shared_future<void> >
+ {
+ typedef void move_dest_type;
+ };
+
+ template<typename T>
+ struct act_traits<unique_future<T&> >
+ {
+ typedef T& move_dest_type;
+ };
+ template <typename R>
+ struct is_movable<unique_future<R> > : mpl::true_{};
+
+ template <typename R>
+ struct has_future_if<unique_future<R> > : mpl::true_{};
+
+ template <typename R>
+ struct has_thread_if<unique_future<R> > : mpl::false_{};
+
+
+ template <typename R>
+ struct is_movable<shared_future<R> > : mpl::true_{};
+
+ template <typename R>
+ struct has_future_if<shared_future<R> > : mpl::true_{};
+
+ template <typename R>
+ struct has_thread_if<shared_future<R> > : mpl::true_{};
+
+ namespace partial_specialization_workaround {
+ template <typename R> struct join<unique_future<R> > {
+ static typename result_of::template join<unique_future<R> >::type
+ apply( unique_future<R>& act) {
+ return act.wait();
+ }
+ };
+ template <typename R> struct join<shared_future<R> > {
+ static typename result_of::template join<shared_future<R> >::type
+ apply( shared_future<R>& act) {
+ return act.wait();
+ }
+ };
+ template <typename R> struct join_until<unique_future<R> > {
+ static typename result_of::template join_until<unique_future<R> >::type
+ apply( unique_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R> struct join_until<shared_future<R> > {
+ static typename result_of::template join_until<shared_future<R> >::type
+ apply( shared_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R, typename Duration> struct join_for<unique_future<R>, Duration> {
+ static typename result_of::template join_for<unique_future<R>,Duration>::type
+ apply( unique_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R, typename Duration> struct join_for<shared_future<R>, Duration> {
+ static typename result_of::template join_for<shared_future<R>,Duration>::type
+ apply( shared_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R> struct wait_until<unique_future<R> > {
+ static typename result_of::template wait_until<unique_future<R> >::type
+ apply( unique_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R> struct wait_until<shared_future<R> > {
+ static typename result_of::template wait_until<shared_future<R> >::type
+ apply( shared_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R, typename Duration> struct wait_for<unique_future<R>, Duration> {
+ static typename result_of::template wait_for<unique_future<R>,Duration>::type
+ apply( unique_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R, typename Duration> struct wait_for<shared_future<R>, Duration> {
+ static typename result_of::template wait_for<shared_future<R>,Duration>::type
+ apply( shared_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ }
+
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/launcher.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/launcher.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,235 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:launcher_hpp Header `<boost/async/launcher.hpp>`]
+[/==========================================================================================]
+
+A launcher is an __AE__ with a future as __FutureBasedACT__ so we can get the value associated to it.
+
+The library defines two kind of launchers:
+unique_launcher and shared_launcher that respectively have a unique_future and a shared_future as __ACT__
+
+ #include <boost/async/fork.hpp>
+ namespace boost { namespace async {
+ class launcher;
+ class shared_launcher;
+
+ namespace partial_specialization_workaround {
+ template <typename R> struct join<unique_future<R> > {
+ static typename result_of::template join<unique_future<R> >::type
+ apply( unique_future<R>& act) {
+ return act.wait();
+ }
+ };
+ template <typename R> struct join<shared_future<R> > {
+ static typename result_of::template join<shared_future<R> >::type
+ apply( shared_future<R>& act) {
+ return act.wait();
+ }
+ };
+ template <typename R> struct join_until<unique_future<R> > {
+ static typename result_of::template join_until<unique_future<R> >::type
+ apply( unique_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R> struct join_until<shared_future<R> > {
+ static typename result_of::template join_until<shared_future<R> >::type
+ apply( shared_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R, typename Duration> struct join_for<unique_future<R>, Duration> {
+ static typename result_of::template join_for<unique_future<R>,Duration>::type
+ apply( unique_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R, typename Duration> struct join_for<shared_future<R>, Duration> {
+ static typename result_of::template join_for<shared_future<R>,Duration>::type
+ apply( shared_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R> struct wait_until<unique_future<R> > {
+ static typename result_of::template wait_until<unique_future<R> >::type
+ apply( unique_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R> struct wait_until<shared_future<R> > {
+ static typename result_of::template wait_until<shared_future<R> >::type
+ apply( shared_future<R>& act, const system_time& abs_time ) {
+ return act.timed_wait_until(abs_time);
+ }
+ };
+ template <typename R, typename Duration> struct wait_for<unique_future<R>, Duration> {
+ static typename result_of::template wait_for<unique_future<R>,Duration>::type
+ apply( unique_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ template <typename R, typename Duration> struct wait_for<shared_future<R>, Duration> {
+ static typename result_of::template wait_for<shared_future<R>,Duration>::type
+ apply( shared_future<R>& act, Duration rel_time ) {
+ return act.timed_wait(rel_time);
+ }
+ };
+ }
+
+ }}
+
+[section Class `launcher `]
+[/==========================================================================================]
+
+Thread launcher using a common configuration managed with the thread attributes and
+returning on the fork operation a unique_future to the resulting type of the call to the threaded function.
+
+ class launcher {
+ public:
+ thread::native_handle_attr_type& attr();
+
+ template <typename T>
+ struct handle {
+ typedef unique_future<T> > type;
+ };
+
+ template <typename F>
+ unique_future<typename result_of<F()>::type>
+ fork(F f);
+ };
+
+[section Member function `launcher::attributes`]
+[/==========================================================================================]
+
+Reference to the thread attributes accesor.
+
+ thread::native_handle_attr_type& attributes();
+
+[variablelist
+[[Returns:] [A reference to the thread attributes.]]
+[[Complexity:] [constant.]]
+]
+
+
+[endsect]
+[section Metafunction `launcher::handle<>`]
+[/==========================================================================================]
+
+Metafunction that returns the result type of the fork function applied to a launcher and the value type.
+
+ template <typename T>
+ struct handle {
+ typedef unique_future<T> > type;
+ };
+
+[variablelist
+[[Expression:] [L::handle<T>::type]]
+[[Return type:] [A unique_future<T>.]]
+[[Complexity:] [constant.]]
+
+]
+
+[endsect]
+
+[section Member function `lancher::fork`]
+[/==========================================================================================]
+
+ template <typename F>
+ unique_future<typename result_of<F()>::type>
+ fork(F f);
+
+[variablelist
+[[Returns:] [A unique_future to the result of calling a function F.]]
+[[Effects:] [create a thread executing the function f.
+ The result of the function will be stored on the resulting future.]]
+
+]
+
+
+[endsect]
+
+
+[endsect]
+
+[section Class `shared_launcher `]
+[/==========================================================================================]
+
+Thread shared_launcher using a common configuration managed with the thread attributes and
+returning on the fork operation a unique_future to the resulting type of the call to the threaded function.
+
+ class shared_launcher {
+ public:
+ thread::native_handle_attr_type& attr();
+
+ template <typename T>
+ struct handle {
+ typedef unique_future<T> > type;
+ };
+
+ template <typename F>
+ unique_future<typename result_of<F()>::type>
+ fork(F f);
+ };
+
+[section Member function `shared_launcher::attributes`]
+[/==========================================================================================]
+
+Reference to the thread attributes accesor.
+
+ thread::native_handle_attr_type& attributes();
+
+[variablelist
+[[Returns:] [A reference to the thread attributes.]]
+[[Complexity:] [constant.]]
+]
+
+
+[endsect]
+[section Metafunction `shared_launcher::handle<>`]
+[/==========================================================================================]
+
+Metafunction that returns the result type of the fork function applied to a shared_launcher and the value type.
+
+ template <typename T>
+ struct handle {
+ typedef unique_future<T> > type;
+ };
+
+[variablelist
+[[Expression:] [L::handle<T>::type]]
+[[Return type:] [A unique_future<T>.]]
+[[Complexity:] [constant.]]
+
+]
+
+[endsect]
+
+[section Member function `lancher::fork`]
+[/==========================================================================================]
+
+ template <typename F>
+ unique_future<typename result_of<F()>::type>
+ fork(F f);
+
+[variablelist
+[[Returns:] [A unique_future to the result of calling a function F.]]
+[[Effects:] [create a thread executing the function f.
+ The result of the function will be stored on the resulting future.]]
+
+]
+
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/launcher_decorator.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/launcher_decorator.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,20 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:launcher_decorator_hpp Header `<boost/async/launcher_decorator.hpp>`]
+[/==========================================================================================]
+
+Shorter names for an __asynchronous_executor_decorator__ based on __launcher__ and __shared_launcher__ respectively and decorated with the __thread_decorator__ .
+
+ namespace boost { namespace async {
+ typedef asynchronous_executor_decorator<launcher,thread_decorator> launcher_decorator;
+ typedef asynchronous_executor_decorator<shared_launcher,thread_decorator> shared_launcher_decorator;
+ }}
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/scheduler.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/scheduler.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,79 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:scheduler_hpp Header `<boost/async/scheduler.hpp>`]
+[/==========================================================================================]
+
+__tp_pool__ can be seen as a __AE__ adding some functions and specializing some traits classes.
+The functions are:
+
+* get_future
+* interruption_requested
+
+The traits are:
+
+* asynchronous_completion_token : associating the __ACT__ __tp_task__
+* partial_specialization_workaround::fork::apply: to call to submit instead of fork.
+
+__tp_task__ is an __ACT__ that models __ThreadBasedACT__ and __FutureBasedACT__.
+
+ namespace boost { namespace async {
+
+ template <typename C>
+ class scheduler {
+ explicit scheduler(
+ tp::poolsize const& psize
+ );
+ template <typename T>
+ struct handle {
+ typedef tp::task<T> type;
+ };
+ template <typename F>
+ tp::task<typename boost::result_of<F()>::type>
+ fork(F f);
+ };
+
+ template <typename Channel>
+ struct get_future<scheduler<Channel> > {
+ template <typename T>
+ struct future_type {
+ typedef shared_future<T> type;
+ };
+ template <typename T>
+ shared_future<T>& operator()(tp::task<T>& act);
+ };
+
+ template <typename Channel, typename T>
+ struct asynchronous_completion_token<boost::tp::pool<Channel>,T> {
+ typedef boost::tp::task<T> type;
+ };
+
+ namespace partial_specialization_workaround {
+ template< typename Channel, typename F >
+ struct fork<boost::tp::pool<Channel>,F> {
+ static typename result_of::fork<boost::tp::pool<Channel>, F>::type
+ apply( boost::tp::pool<Channel>& ae, F fn );
+ };
+ }
+ template <typename C>
+ struct get_future<tp::pool<C> > {
+ template <typename T>
+ shared_future<T>& operator()(tp::task<T>& act);
+ };
+
+
+ template <typename R>
+ struct has_future_if<tp::task<R> > : mpl::true_{};
+
+ template <typename R>
+ struct has_thread_if<tp::task<R> > : mpl::true_{};
+ }}
+
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/threader.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/threader.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,768 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:threader_hpp Header `<boost/async/threader.hpp>`]
+[/==========================================================================================]
+
+A threader is an __AE__ with an __ACT__ that model __ThreadBasedACT__ and __FutureBasedACT__.
+
+The library defines two kind of threaders:
+unique_threader and shared_threader that respectively have a unique_joiner and a shared_joiner as __ACT__
+
+ #include <boost/async/fork.hpp>
+ namespace boost {
+ namespace async {
+ template <typename ResultType>
+ class unique_joiner;
+
+ template <typename ResultType>
+ void swap(unique_joiner<ResultType>& lhs, unique_joiner<ResultType>& rhs);
+
+ class unique_threader;
+
+ template <typename ResultType>
+ class shared_joiner;
+
+ template <typename ResultType>
+ void swap(shared_joiner<ResultType>& lhs, shared_joiner<ResultType>& rhs);
+
+ class shared_threader;
+ }
+ }
+
+[/==================================================]
+[section Template Class `unique_joiner<>`]
+[/==========================================================================================]
+
+
+ template <typename ResultType>
+ class unique_joiner {
+ typedef unique_joiner this_type;
+ public:
+ unique_joiner(const unique_joiner& rhs) = delete;
+ unique_joiner& operator=(const unique_joiner& rhs) = delete;
+
+ typedef ResultType result_type;
+
+ template <typename Nullary>
+ unique_joiner(thread::native_handle_attr_type& attr, Nullary f);
+ template <typename Nullary>
+ unique_joiner(Nullary f);
+
+ unique_joiner(boost::detail::thread_move_t<unique_joiner> x);
+ unique_joiner& operator=(boost::detail::thread_move_t<unique_joiner> x);
+ operator boost::detail::thread_move_t<unique_joiner>();
+ boost::detail::thread_move_t<unique_joiner> move();
+
+ void swap(this_type& x);
+
+ bool joinable() const;
+ void join();
+ bool join_until(const system_time& abs_time);
+ template<typename TimeDuration>
+ inline bool join_for(TimeDuration const& rel_time);
+
+ result_type get();
+ result_type operator()();
+
+ bool is_ready() const;
+ bool has_exception() const;
+ bool has_value() const;
+
+ void wait() const;
+ bool wait_until(const system_time& abs_time) const;
+ template<typename TimeDuration>
+ inline bool wait_for(TimeDuration const& rel_time) const;
+
+ thread::id get_id() const;
+ void detach();
+ void interrupt();
+ bool interruption_requested() const;
+
+ typedef platform-specific-type native_handle_type;
+ native_handle_type native_handle();
+
+ unique_future<result_type> get_future();
+
+ };
+
+
+[section:destructor unique_joiner Destructor]
+[/==========================================================================================]
+
+ ~unique_joiner();
+
+[variablelist
+[[Effects:] [If `*this` has an associated thread of execution, calls __detach__. Destroys `*this`.]]
+[[Throws:] [Nothing.]]
+]
+
+[endsect]
+
+[section:swap Member function `swap()`]
+
+ void swap(unique_joiner& other);
+
+[variablelist
+[[Effects:] [Exchanges the threads of execution associated with `*this` and `other`, so `*this` is associated with the thread of
+execution associated with `other` prior to the call, and vice-versa.]]
+[[Postconditions:] [`this->get_id()` returns the same value as `other.get_id()` prior to the call. `other.get_id()` returns the same
+value as `this->get_id()` prior to the call.]]
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+
+[section Member Function `get()|operator()()`]
+[/==========================================================================================]
+
+ result_type get();
+ result_type operator()();
+
+[variablelist
+[[Effects:] [Retrieves the value returned by the Nullary function.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before get() returns.]]
+[[Returns:] [If the result type R is a reference, returns the stored reference.
+If R is void, there is no return value.
+Otherwise, returns an rvalue-reference to the value stored in the asynchronous result.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [It is unspecified what happens when get() is called a second time on the same unique_joiner.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+
+[section Member Function `is_ready()`]
+[/==========================================================================================]
+
+ bool is_ready() const;
+
+[variablelist
+[[Returns:] [true only if the associated state holds a value or an exception ready for retrieval.]]
+[[Remark:] [the return value is unspecified after a call to get().]]
+]
+[endsect]
+
+[section Member Function `has_exception()`]
+[/==========================================================================================]
+
+ bool has_exception() const;
+
+[variablelist
+[[Returns:] [true only if is_ready() == true and the associated state contains an exception.]]
+]
+[endsect]
+
+[section Member Function `has_value()`]
+[/==========================================================================================]
+
+ bool has_value() const;
+
+[variablelist
+[[Returns:] [true only if is_ready() == true and the associated state contains a value.]]
+]
+[endsect]
+
+[section Member Function `wait()`]
+[/==========================================================================================]
+
+ void wait();
+
+[variablelist
+[[Effects:] [Blocks until the Nullariry function ends.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before wait() returns.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [is_ready() == true.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+[section Member Function `wait_until()|wait_for()`]
+[/==========================================================================================]
+
+ bool wait_until(const system_time& abs_time);
+ template<typename TimeDuration>
+ bool wait_for(TimeDuration const& rel_time);
+
+
+[variablelist
+[[Effects:] [Blocks until the Nullariry function ends.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before wait() returns.]]
+[[Returns:] [If the result type R is a reference, returns the stored reference.
+If R is void, there is no return value.
+Otherwise, returns an rvalue-reference to the value stored in the asynchronous result.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [is_ready() == true.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+
+
+[section:joinable Member function `joinable()`]
+[/==========================================================================================]
+
+ bool joinable() const;
+
+[variablelist
+[[Returns:] [`true` if `*this` refers to a thread of execution, `false` otherwise.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+[section:join Member function `join()`]
+[/==========================================================================================]
+
+ void join();
+
+[variablelist
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete.]]
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, that thread of execution has completed. `*this` no longer refers to any thread of execution.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Notes:] [`join()` is one of the predefined __interruption_points__.]]
+]
+
+[endsect]
+
+[section Member function `join_until()|join_for()`]
+[/==========================================================================================]
+
+ bool join_until(const system_time& wait_until);
+
+ template<typename TimeDuration>
+ bool join_for(TimeDuration const& rel_time);
+
+[variablelist
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete, the time `wait_until` has
+been reach or the specified duration `rel_time` has elapsed. If `*this` doesn't refer to a thread of execution, returns immediately.]]
+[[Returns:] [`true` if `*this` refers to a thread of execution on entry, and that thread of execution has completed before the call
+times out, `false` otherwise.]]
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, and `timed_join` returns `true`, that thread of execution
+has completed, and `*this` no longer refers to any thread of execution. If this call to `timed_join` returns `false`, `*this` is
+unchanged.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Notes:] [`timed_join()` is one of the predefined __interruption_points__.]]
+]
+
+[endsect]
+
+[section:detach Member function `detach()`]
+[/==========================================================================================]
+
+ void detach();
+
+[variablelist
+[[Effects:] [If `*this` refers to a thread of execution, that thread of execution becomes detached, and no longer has an associated __thread__ object.]]
+[[Postconditions:] [`*this` no longer refers to any thread of execution.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+
+[section:get_id Member function `get_id()`]
+[/==========================================================================================]
+
+ thread::id get_id() const;
+
+[variablelist
+[[Returns:] [If `*this` refers to a thread of execution, an instance of __thread_id__ that represents that thread. Otherwise returns
+a default-constructed __thread_id__.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+[section:interrupt Member function `interrupt()`]
+[/==========================================================================================]
+
+ void interrupt();
+
+[variablelist
+[[Effects:] [If `*this` refers to a thread of execution, request that the thread will be interrupted the next time it enters one of
+the predefined __interruption_points__ with interruption enabled, or if it is currently __blocked__ in a call to one of the
+predefined __interruption_points__ with interruption enabled .]]
+[[Throws:] [Nothing]]
+]
+
+
+[endsect]
+
+
+[section:nativehandle Member function `native_handle()`]
+[/==========================================================================================]
+
+ typedef platform-specific-type native_handle_type;
+ native_handle_type native_handle();
+
+[variablelist
+[[Effects:] [Returns an instance of `native_handle_type` that can be used with platform-specific APIs to manipulate the underlying
+implementation. If no such instance exists, `native_handle()` and `native_handle_type` are not present.]]
+[[Throws:] [Nothing.]]
+]
+
+[endsect]
+
+
+
+[endsect]
+[section:non_member_swap Non-member function `swap()`]
+
+ void swap(unique_joiner& lhs,unique_joiner& rhs);
+
+[variablelist
+
+[[Effects:] [`lhs.swap(rhs)`.]]
+
+]
+
+[endsect]
+
+[/==================================================]
+[section Template Class `unique_threader`]
+[/==========================================================================================]
+
+ class unique_threader {
+ public:
+ thread::native_handle_attr_type& attributes();
+
+ template <typename T>
+ struct handle {
+ typedef unique_joiner<T> type;
+ };
+
+ template <typename F>
+ unique_joiner<typename result_of<F()>::type>
+ fork(F f);
+
+ };
+
+[section Member function `unique_threader::attributes()`]
+[/==========================================================================================]
+
+Reference to the thread attributes accesor.
+
+ thread::native_handle_attr_type& attributes();
+
+[variablelist
+[[Returns:] [A reference to the thread attributes.]]
+[[Complexity:] [constant.]]
+]
+
+
+[endsect]
+[section Metafunction `unique_threader::handle<>`]
+[/==========================================================================================]
+
+Metafunction that returns the result type of the fork function applied to a unique_threader and the value type.
+
+ template <typename T>
+ struct handle {
+ typedef unique_joiner<T> type;
+ };
+
+
+[variablelist
+[[Expression:] [L::handle<T>::type]]
+[[Return type:] [A unique_joiner<T>.]]
+[[Complexity:] [constant.]]
+
+]
+
+[endsect]
+
+[section Member function `unique_threader::fork`]
+[/==========================================================================================]
+
+ template <typename F>
+ unique_joiner<typename result_of<F()>::type>
+ fork(F f);
+
+[variablelist
+[[Returns:] [A unique_joiner to the result of calling a function F.]]
+[[Effects:] [create a thread executing the function f.
+ The result of the function will be stored on the resulting unique_joiner.]]
+
+]
+
+
+[endsect]
+
+[endsect]
+
+[/==================================================]
+[section Template Class `shared_joiner<>`]
+[/==========================================================================================]
+
+ template <typename ResultType>
+ class shared_joiner {
+ typedef shared_joiner this_type;
+ public:
+ shared_joiner(const shared_joiner& rhs);
+ shared_joiner& operator=(const shared_joiner& rhs);
+
+ typedef ResultType result_type;
+
+ template <typename Nullary>
+ shared_joiner(thread::native_handle_attr_type& attr, Nullary f);
+ template <typename Nullary>
+ shared_joiner(Nullary f);
+
+ shared_joiner(boost::detail::thread_move_t<shared_joiner> x);
+ shared_joiner& operator=(boost::detail::thread_move_t<shared_joiner> x);
+ operator boost::detail::thread_move_t<shared_joiner>();
+ boost::detail::thread_move_t<shared_joiner> move();
+
+ void swap(this_type& x);
+
+ bool joinable() const;
+ void join();
+ bool join_until(const system_time& abs_time);
+ template<typename TimeDuration>
+ inline bool join_for(TimeDuration const& rel_time);
+
+ result_type get();
+ result_type operator()();
+
+ bool is_ready() const;
+ bool has_exception() const;
+ bool has_value() const;
+
+ void wait() const;
+ bool wait_until(const system_time& abs_time) const;
+ template<typename TimeDuration>
+ inline bool wait_for(TimeDuration const& rel_time) const;
+
+ thread::id get_id() const;
+ void detach();
+ void interrupt();
+ bool interruption_requested() const;
+
+ typedef platform-specific-type native_handle_type;
+ native_handle_type native_handle();
+
+ shared_future<result_type> get_future();
+ };
+
+
+[section:destructor shared_joiner Destructor]
+[/==========================================================================================]
+
+ ~shared_joiner();
+
+[variablelist
+[[Effects:] [If `*this` has an associated thread of execution, calls __detach__. Destroys `*this`.]]
+[[Throws:] [Nothing.]]
+]
+
+[endsect]
+
+[section:swap2 Member function `swap()`]
+
+ void swap(shared_joiner& other);
+
+[variablelist
+[[Effects:] [Exchanges the threads of execution associated with `*this` and `other`, so `*this` is associated with the thread of
+execution associated with `other` prior to the call, and vice-versa.]]
+[[Postconditions:] [`this->get_id()` returns the same value as `other.get_id()` prior to the call. `other.get_id()` returns the same
+value as `this->get_id()` prior to the call.]]
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+
+[section Member Function `get()|operator()()`]
+[/==========================================================================================]
+
+ result_type get();
+ result_type operator()();
+
+[variablelist
+[[Effects:] [Retrieves the value returned by the Nullary function.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before get() returns.]]
+[[Returns:] [If the result type R is a reference, returns the stored reference.
+If R is void, there is no return value.
+Otherwise, returns an rvalue-reference to the value stored in the asynchronous result.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [It is unspecified what happens when get() is called a second time on the same shared_joiner.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+
+[section Member Function `is_ready()`]
+[/==========================================================================================]
+
+ bool is_ready() const;
+
+[variablelist
+[[Returns:] [true only if the associated state holds a value or an exception ready for retrieval.]]
+[[Remark:] [the return value is unspecified after a call to get().]]
+]
+[endsect]
+
+[section Member Function `has_exception()`]
+[/==========================================================================================]
+
+ bool has_exception() const;
+
+[variablelist
+[[Returns:] [true only if is_ready() == true and the associated state contains an exception.]]
+]
+[endsect]
+
+[section Member Function `has_value()`]
+[/==========================================================================================]
+
+ bool has_value() const;
+
+[variablelist
+[[Returns:] [true only if is_ready() == true and the associated state contains a value.]]
+]
+[endsect]
+
+[section Member Function `wait()`]
+[/==========================================================================================]
+
+ void wait();
+
+[variablelist
+[[Effects:] [Blocks until the Nullariry function ends.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before wait() returns.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [is_ready() == true.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+[section Member Function `wait_until()|wait_for()`]
+[/==========================================================================================]
+
+ bool wait_until(const system_time& abs_time);
+ template<typename TimeDuration>
+ bool wait_for(TimeDuration const& rel_time);
+
+
+[variablelist
+[[Effects:] [Blocks until the Nullariry function ends.]]
+[[Sychronization:][The completion of the call to the operator()() the Nullary function happens before wait() returns.]]
+[[Returns:] [If the result type R is a reference, returns the stored reference.
+If R is void, there is no return value.
+Otherwise, returns an rvalue-reference to the value stored in the asynchronous result.]]
+[[Throws:] [the stored exception, if an exception was stored and not retrieved before.]]
+[[Postconditions:] [is_ready() == true.]]
+[[Thread safety:][unsafe]]
+]
+[endsect]
+
+
+
+[section:joinable2 Member function `joinable()`]
+[/==========================================================================================]
+
+ bool joinable() const;
+
+[variablelist
+[[Returns:] [`true` if `*this` refers to a thread of execution, `false` otherwise.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+[section:join2 Member function `join()`]
+[/==========================================================================================]
+
+ void join();
+
+[variablelist
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete.]]
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, that thread of execution has completed. `*this` no longer refers to any thread of execution.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Notes:] [`join()` is one of the predefined __interruption_points__.]]
+]
+
+[endsect]
+
+[section Member function `join_until()|join_for()`]
+[/==========================================================================================]
+
+ bool join_until(const system_time& wait_until);
+
+ template<typename TimeDuration>
+ bool join_for(TimeDuration const& rel_time);
+
+[variablelist
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete, the time `wait_until` has
+been reach or the specified duration `rel_time` has elapsed. If `*this` doesn't refer to a thread of execution, returns immediately.]]
+[[Returns:] [`true` if `*this` refers to a thread of execution on entry, and that thread of execution has completed before the call
+times out, `false` otherwise.]]
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, and `timed_join` returns `true`, that thread of execution
+has completed, and `*this` no longer refers to any thread of execution. If this call to `timed_join` returns `false`, `*this` is
+unchanged.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Notes:] [`timed_join()` is one of the predefined __interruption_points__.]]
+]
+
+[endsect]
+
+[section:detach3 Member function `detach()`]
+[/==========================================================================================]
+
+ void detach();
+
+[variablelist
+[[Effects:] [If `*this` refers to a thread of execution, that thread of execution becomes detached, and no longer has an associated __thread__ object.]]
+[[Postconditions:] [`*this` no longer refers to any thread of execution.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+
+[section:get_id2 Member function `get_id()`]
+[/==========================================================================================]
+
+ thread::id get_id() const;
+
+[variablelist
+[[Returns:] [If `*this` refers to a thread of execution, an instance of __thread_id__ that represents that thread. Otherwise returns
+a default-constructed __thread_id__.]]
+[[Throws:] [Nothing]]
+]
+
+[endsect]
+
+[section:interrupt2 Member function `interrupt()`]
+[/==========================================================================================]
+
+ void interrupt();
+
+[variablelist
+[[Effects:] [If `*this` refers to a thread of execution, request that the thread will be interrupted the next time it enters one of
+the predefined __interruption_points__ with interruption enabled, or if it is currently __blocked__ in a call to one of the
+predefined __interruption_points__ with interruption enabled .]]
+[[Throws:] [Nothing]]
+]
+
+
+[endsect]
+
+
+[section:nativehandle2 Member function `native_handle()`]
+[/==========================================================================================]
+
+ typedef platform-specific-type native_handle_type;
+ native_handle_type native_handle();
+
+[variablelist
+[[Effects:] [Returns an instance of `native_handle_type` that can be used with platform-specific APIs to manipulate the underlying
+implementation. If no such instance exists, `native_handle()` and `native_handle_type` are not present.]]
+[[Throws:] [Nothing.]]
+]
+
+[endsect]
+
+
+
+[endsect]
+[section:non_member_swap2 Non-member function `swap()`]
+
+ void swap(shared_joiner& lhs,shared_joiner& rhs);
+
+[variablelist
+
+[[Effects:] [`lhs.swap(rhs)`.]]
+
+]
+
+[endsect]
+
+[/==================================================]
+[section Template Class `shared_threader`]
+[/==========================================================================================]
+
+ class shared_threader {
+ public:
+ thread::native_handle_attr_type& attributes();
+
+ template <typename T>
+ struct handle {
+ typedef shared_joiner<T> type;
+ };
+
+ template <typename F>
+ shared_joiner<typename result_of<F()>::type>
+ fork(F f);
+
+ };
+
+[section Member function `shared_threader::attributes()`]
+[/==========================================================================================]
+
+Reference to the thread attributes accesor.
+
+ thread::native_handle_attr_type& attributes();
+
+[variablelist
+[[Returns:] [A reference to the thread attributes.]]
+[[Complexity:] [constant.]]
+]
+
+
+[endsect]
+[section Metafunction `shared_threader::handle<>`]
+[/==========================================================================================]
+
+Metafunction that returns the result type of the fork function applied to a shared_threader and the value type.
+
+ template <typename T>
+ struct handle {
+ typedef shared_joiner<T> type;
+ };
+
+
+[variablelist
+[[Expression:] [L::handle<T>::type]]
+[[Return type:] [A shared_joiner<T>.]]
+[[Complexity:] [constant.]]
+
+]
+
+[endsect]
+
+[section Member function `shared_threader::fork`]
+[/==========================================================================================]
+
+ template <typename F>
+ shared_joiner<typename result_of<F()>::type>
+ fork(F f);
+
+[variablelist
+[[Returns:] [A shared_joiner to the result of calling a function F.]]
+[[Effects:] [create a thread executing the function f.
+ The result of the function will be stored on the resulting shared_joiner.]]
+
+]
+
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+

Added: sandbox/async/libs/async/doc/reference/typeof/basic_threader.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/typeof/basic_threader.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,22 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:typeof_basic_threaderr_hpp Header `<boost/async/typeof/basic_threader.hpp>`]
+[/==========================================================================================]
+
+Include this files instead of `<boost/async/basic_threader.hpp>` if you want TypeOf support.
+
+ #include <boost/async/basic_threader.hpp>
+ #include <boost/typeof/typeof.hpp>
+
+ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+ BOOST_TYPEOF_REGISTER_TYPE(boost::async::basic_threader)
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/typeof/futures.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/typeof/futures.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,25 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:typeof_futures_hpp Header `<boost/async/typeof/future.hpp>`]
+[/==========================================================================================]
+
+Include this files instead of `<boost/futures/future.hpp>` if you want TypeOf support.
+
+ #include <boost/futures/future.hpp>
+ #include <boost/typeof/typeof.hpp>
+
+ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::unique_future, 1)
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::shared_future, 1)
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::promise, 1)
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::packaged_task, 1)
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/typeof/launcher.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/typeof/launcher.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,25 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+
+[/==========================================================================================]
+[section:typeof_launcher_hpp Header `<boost/async/typeof/launcher.hpp>`]
+[/==========================================================================================]
+
+Include this files instead of `<boost/async/launcher.hpp>` if you want TypeOf support.
+
+ #include <boost/async/launcher.hpp>
+ #include <boost/async/typeof/future.hpp>
+ #include <boost/typeof/typeof.hpp>
+
+ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+ BOOST_TYPEOF_REGISTER_TYPE(boost::async::launcher)
+ BOOST_TYPEOF_REGISTER_TYPE(boost::async::shared_launcher)
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/typeof/scheduler.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/typeof/scheduler.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,24 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:typeof_scheduler_hpp Header `<boost/async/typeof/scheduler.hpp>`]
+[/==========================================================================================]
+
+Include this files instead of `<boost/async/scheduler.hpp>` if you want TypeOf support.
+
+ #include <boost/async/scheduler.hpp>
+ #include <boost/typeof/typeof.hpp>
+
+ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::tp::task, 1)
+
+[endsect]
+
+
+

Added: sandbox/async/libs/async/doc/reference/typeof/threader.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/typeof/threader.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,26 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:typeof_threader_hpp Header `<boost/async/typeof/threader.hpp>`]
+[/==========================================================================================]
+
+Include this files instead of `<boost/async/threader.hpp>` if you want TypeOf support.
+
+ #include <boost/async/threader.hpp>
+ #include <boost/typeof/typeof.hpp>
+
+ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+ BOOST_TYPEOF_REGISTER_TYPE(boost::async::unique_threader)
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::unique_joiner, 1)
+
+ BOOST_TYPEOF_REGISTER_TYPE(boost::async::shared_threader)
+ BOOST_TYPEOF_REGISTER_TEMPLATE(boost::async::shared_joiner, 1)
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/wait.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,51 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_hpp Header `<boost/async/algorithm/wait.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __wait__ which waits the __ACT__ passed as parameter.
+The default implementation applies the __wait__ member function to the __ACT__. A user adapting another __ACT__ could need
+to specialize the __wait__ free function if the __ACT__ do not provides a wait function with the same prototype.
+
+As for the moment we can not partially specialize a function a trick is used: instead of calling directly to the __wait__
+member function, __wait__ calls to the static operation apply on a class with the same name in the namespace __partial_specialization_workaround__.
+So the user can specialize partially this class.
+
+The template parameter ACT must be a model of __FutureBasedACT__.
+
+ namespace boost {
+ namespace async {
+
+ namespace result_of {
+ template <typename ACT> struct wait {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct wait {
+ static typename result_of::wait<ACT>::type apply( ACT& act ) {
+ return act.wait();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::wait<ACT>::type
+ >::type
+ wait(ACT& act) {
+ return partial_specialization_workaround::wait<ACT>::apply(act);
+ }
+
+ }
+ } // namespace boost
+
+
+[endsect]

Added: sandbox/async/libs/async/doc/reference/wait_all.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait_all.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,40 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_all_hpp Header `<boost/async/algorithm/wait_all.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __wait_all__ which waits the completion of all the __ACT__ in the sequence passed as parameter.
+
+ namespace boost {
+ namespace async {
+
+ namespace fct {
+ struct wait {
+ typedef void result_type;
+ template<typename ACT>
+ void operator()(ACT& act) const;
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence>
+ struct wait_all {
+ typedef typename fusion::result_of::for_each<Sequence, fct::wait>::type type;
+ };
+ }
+
+ template <typename Sequence>
+ typename result_of::wait_all<Sequence>::type
+ wait_all(Sequence& t);
+
+ }
+ } // namespace boost
+
+
+[endsect]

Added: sandbox/async/libs/async/doc/reference/wait_all_until.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait_all_until.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,54 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_all_until_hpp Header `<boost/async/algorithm/wait_all_until.hpp>`]
+[/==========================================================================================]
+
+Defines two free function __wait_all_until__ and __wait_all_for__ which waits the completion of all the __ACT__ in the sequence passed as parameter or a given time is reached or elapsed respectively.
+
+ namespace boost {
+ namespace async {
+
+ namespace fct {
+ struct wait_until {
+ wait_until(const system_time& abs_time);
+ template<typename ACT>
+ bool operator()(ACT& act) const;
+
+ struct wait_for {
+ template <typename Duration>
+ wait_for(const Duration& rel_time);
+ template<typename ACT>
+ bool operator()(ACT& act) const;
+ }
+
+ namespace result_of {
+ template <typename Sequence>
+ struct wait_all_until {
+ typedef bool type;
+ };
+
+ template <typename Sequence>
+ struct wait_all_for {
+ typedef bool type;
+ };
+ }
+
+ template <typename Sequence>
+ typename result_of::wait_all_until<Sequence const>
+ wait_all_until(Sequence const& t, const system_time& abs_time);
+
+ template <typename Sequence, typename Duration>
+ typename result_of::wait_all_for<Sequence>
+ wait_all_for(Sequence& t, const Duration& rel_time);
+
+ }
+ }
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/wait_for_all.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait_for_all.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,89 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_for_all_hpp Header `<boost/async/wait_for_all.hpp>`]
+[/==========================================================================================]
+
+ namespace boost {
+ namespace async {
+ namespace result_of {
+ template <typename AE, typename F1, ..., typename Fn>
+ struct wait_for_all {
+ typedef fusion::tuple<
+ typename result_of<F1()>::type,
+ ...
+ typename result_of<Fn()>::type,
+ > type;
+ };
+ }
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::wait_for_all<AE, F1, ..., Fn>::type
+ wait_for_all( AE& ae, F1 f1, ..., Fn fn );
+ }
+ }
+
+[section Metafunction `result_of::wait_for_all<AE,F1, ..., Fn> `]
+[/==========================================================================================]
+
+A metafunction returning the result type of applying get_all to a Sequence of asynchronous executor handles.
+
+ namespace result_of {
+ template <typename AE, typename F1, ..., typename Fn>
+ struct wait_for_all {
+ typedef fusion::tuple<
+ typename result_of<F1()>::type,
+ ...
+ typename result_of<Fn()>::type,
+ > type;
+ };
+ }
+
+[table wait_for_all Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of `AsynchrousExecutor`]
+ [Operation's argument ]
+ ]
+ [
+ [`Fk`]
+ [A model of nullary function]
+ [Operation's argument ]
+ ]
+]
+
+[variablelist
+[[Expression:] [`result_of::wait_for_all<AE, F1, ..., Fn>::type`]]
+[[Return type:] [a fusion tuple of the result of applying get to each one of the asynchronous executors handles resulting of forking each function `Fk` by `AE`]]
+]
+
+[endsect]
+
+[section Non member function `wait_for_all`]
+[/==========================================================================================]
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::wait_for_all<AE, F1, ..., Fn>::type
+ wait_for_all( AE& ae, F1 f1, ..., Fn fn );
+
+
+[variablelist
+[[Returns:] [a fusion tuple of the result of applying get to each one of the asynchronous executors handles resulting of forking each function `fk` by `ae`.]]
+[[Effect:] [Request the `AE` to creates a n thread of execution one for the function `fk` and
+blocks until all the AE handles are ready.]]
+
+]
+
+[endsect]
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/wait_for_any.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait_for_any.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,84 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_for_any_hpp Header `<boost/async/wait_for_any.hpp>`]
+[/==========================================================================================]
+
+ namespace boost { namespace async {
+ namespace result_of {
+ template <typename AE, typename F1, ..., typename Fn>
+ struct wait_for_any {
+ // requires typename result_of<F1()>::type == typename result_of<Fk()>::type
+ typedef std::pair<unsigned,typename result_of<F1()>::type> type;
+ };
+ }
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::wait_for_any<AE, F1, ..., Fn>::type
+ wait_for_any( AE& ae, F1 f1, ..., Fn fn );
+ }}
+
+[section Metafunction `result_of::wait_for_all<AE,F1, ..., Fn> `]
+[/==========================================================================================]
+
+A metafunction returning the a pair: the index of the first function executed by the AE and the result type
+of applying get on an asynchronous executor handles.
+
+ namespace result_of {
+ template <typename AE, typename F1, ..., typename Fn>
+ struct wait_for_any {
+ // requires typename result_of<F1()>::type == typename result_of<Fk()>::type
+ typedef std::pair<unsigned,typename result_of<F1()>::type> type;
+ };
+ }
+
+[table wait_for_all Parameters
+ [
+ [[*Parameter]]
+ [[*Requirement]]
+ [[*Description]]
+ ]
+ [
+ [`AE`]
+ [A model of `AsynchrousExecutor`]
+ [Operation's argument ]
+ ]
+ [
+ [`Fk`]
+ [A model of nullary function]
+ [Operation's argument ]
+ ]
+]
+
+[variablelist
+[[Expression:] [`result_of::wait_for_any<AE, F1, ..., Fn>::type`]]
+[[Return type:] [a pair: the index of the first function executed by the AE and the result type
+of applying get on an asynchronous executor handles created by `ae` to fork each `fk`]]
+]
+
+[endsect]
+
+[section Non member function `wait_for_any`]
+[/==========================================================================================]
+
+ template< typename AE, typename F1, ..., typename Fn>
+ typename result_of::wait_for_any<AE, F1, ..., Fn>::type
+ wait_for_any( AE& ae, F1 f1, ..., Fn fn );
+
+
+[variablelist
+[[Returns:] [a fusion tuple of the result of applying get to each one of the asynchronous executors handles resulting of forking each function `fk` by `ae`.]]
+[[Effect:] [Request the `AE` to creates a n thread of execution one for the function `fk` and
+blocks until all the AE handles are ready.]]
+
+]
+
+[endsect]
+
+[endsect]
+

Added: sandbox/async/libs/async/doc/reference/wait_until.qbk
==============================================================================
--- (empty file)
+++ sandbox/async/libs/async/doc/reference/wait_until.qbk 2009-06-25 11:06:55 EDT (Thu, 25 Jun 2009)
@@ -0,0 +1,63 @@
+[/
+ (C) Copyright 2008-2009 Vicente J. Botet Escriba
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[/==========================================================================================]
+[section:wait_until_hpp Header `<boost/async/algorithm/wait_until.hpp>`]
+[/==========================================================================================]
+
+Defines a free function __wait_until__ which wait until the __ACT__ passed as parameter is ready or the given time is reached.
+The default implementation applies the __wait_until__ member function to the __ACT__. A user adapting another __ACT__ could need
+to specialize the __wait_until__ free function if the __ACT__ do not provides a wait_until function with the same prototype.
+
+As for the moment we can not partially specialize a function a trick is used: instead of calling directly to the __wait_until__
+member function, __wait_until__ calls to the static operation apply on a class with the same name in the namespace __partial_specialization_workaround__.
+So the user can specialize partially this class.
+
+Defines a free function __wait_for__ which wait until the __ACT__ passed as parameter is ready or the given time is elapsed.
+The default implementation applies the __wait_for__ member function to the __ACT__. A user adapting another __ACT__ could need
+to specialize the __wait_for__ free function if the __ACT__ do not provides a __wait_for__ function with the same prototype.
+
+As for the moment we can not partially specialize a function a trick is used: instead of calling directly to the __wait_until__
+member function, __wait_for__ calls to the static operation apply on a class with the same name in the namespace __partial_specialization_workaround__.
+So the user can specialize partially this class.
+
+The template parameter ACT must be a model of __FutureBasedACT__.
+
+ namespace boost { namespace async {
+ namespace result_of {
+ template <typename ACT> struct wait_until {
+ typedef bool type;
+ };
+ template <typename ACT, typename Duration> struct wait_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct wait_until {
+ static typename result_of::template wait_until<ACT>::type apply( ACT& act, const system_time& abs_time );
+ };
+ template< typename ACT, typename Duration> struct wait_for {
+ static typename result_of::template wait_for<ACT,Duration>::type apply( ACT& act, Duration abs_time );
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait_until<ACT>::type
+ >::type wait_until(ACT& act, const system_time& abs_time);
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait_for<ACT,Duration>::type
+ >::type wait_for(ACT& act, Duration rel_time);
+
+ }
+ } // namespace boost
+
+[endsect]
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk