$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r54717 - in branches/release: boost/statechart libs/statechart/doc libs/statechart/test
From: ahd6974-boostorg_at_[hidden]
Date: 2009-07-06 14:35:52
Author: andreas_huber69
Date: 2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
New Revision: 54717
URL: http://svn.boost.org/trac/boost/changeset/54717
Log:
Merged 1.40 bug fixes from trunk to release branch.
Text files modified: 
   branches/release/boost/statechart/fifo_worker.hpp            |     2                                         
   branches/release/boost/statechart/processor_container.hpp    |   110 ++++++++++++++++++++++++++-----------   
   branches/release/libs/statechart/doc/acknowledgments.html    |    13 ++--                                    
   branches/release/libs/statechart/doc/future_and_history.html |    12 +++                                     
   branches/release/libs/statechart/test/FifoSchedulerTest.cpp  |   114 ++++++++++++++++++++++++++++++--------- 
   5 files changed, 181 insertions(+), 70 deletions(-)
Modified: branches/release/boost/statechart/fifo_worker.hpp
==============================================================================
--- branches/release/boost/statechart/fifo_worker.hpp	(original)
+++ branches/release/boost/statechart/fifo_worker.hpp	2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
@@ -103,7 +103,7 @@
 
     void terminate()
     {
-      work_item item = bind( &fifo_worker::terminate_impl, this );
+      work_item item = boost::bind( &fifo_worker::terminate_impl, this );
       queue_work_item( item );
     }
 
Modified: branches/release/boost/statechart/processor_container.hpp
==============================================================================
--- branches/release/boost/statechart/processor_container.hpp	(original)
+++ branches/release/boost/statechart/processor_container.hpp	2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
@@ -12,6 +12,7 @@
 #include <boost/statechart/event_processor.hpp>
 
 #include <boost/assert.hpp>
+#include <boost/ref.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/shared_ptr.hpp>
@@ -31,7 +32,29 @@
 {
 namespace statechart
 {
-
+namespace detail
+{
+  template<bool IsReferenceWrapper>
+  struct unwrap_impl
+  {
+    template< typename T >
+    struct apply { typedef T type; };
+  };
+
+  template<>
+  struct unwrap_impl<true>
+  {
+    template< typename T >
+    struct apply { typedef typename T::type & type; };
+  };
+
+  template<typename T>
+  struct unwrap
+  {
+    typedef typename unwrap_impl<
+      is_reference_wrapper< T >::value >::template apply< T >::type type;
+  };
+}
 
 
 template<
@@ -43,6 +66,7 @@
   typedef event_processor< Scheduler > processor_base_type;
   typedef std::auto_ptr< processor_base_type > processor_holder_type;
   typedef shared_ptr< processor_holder_type > processor_holder_ptr_type;
+
   public:
     //////////////////////////////////////////////////////////////////////////
     typedef weak_ptr< processor_holder_type > processor_handle;
@@ -90,7 +114,7 @@
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl0< Processor >;
       return WorkItem(
-        bind( pImpl, this, pProcessor,
+        boost::bind( pImpl, this, pProcessor,
           processor_context( scheduler, handle ) ),
         Allocator() );
     }
@@ -101,13 +125,15 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &, const processor_context &, Arg1 );
+        const processor_holder_ptr_type &, const processor_context &,
+        arg1_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl1<
-          Processor, Arg1 >;
+          Processor, arg1_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1 ),
         Allocator() );
     }
@@ -118,14 +144,16 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
+      typedef typename detail::unwrap< Arg2 >::type arg2_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &,
-        const processor_context &, Arg1, Arg2 );
+        const processor_holder_ptr_type &, const processor_context &,
+         arg1_type, arg2_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl2<
-          Processor, Arg1, Arg2 >;
+          Processor, arg1_type, arg2_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1, arg2 ),
         Allocator() );
     }
@@ -137,15 +165,17 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
+      typedef typename detail::unwrap< Arg2 >::type arg2_type;
+      typedef typename detail::unwrap< Arg3 >::type arg3_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &,
-        const processor_context &,
-        Arg1, Arg2, Arg3 );
+        const processor_holder_ptr_type &, const processor_context &,
+        arg1_type, arg2_type, arg3_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl3<
-          Processor, Arg1, Arg2, Arg3 >;
+          Processor, arg1_type, arg2_type, arg3_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1, arg2, arg3 ),
         Allocator() );
     }
@@ -159,15 +189,18 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
+      typedef typename detail::unwrap< Arg2 >::type arg2_type;
+      typedef typename detail::unwrap< Arg3 >::type arg3_type;
+      typedef typename detail::unwrap< Arg4 >::type arg4_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &,
-        const processor_context &,
-        Arg1, Arg2, Arg3, Arg4 );
+        const processor_holder_ptr_type &, const processor_context &,
+        arg1_type, arg2_type, arg3_type, arg4_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl4<
-          Processor, Arg1, Arg2, Arg3, Arg4 >;
+          Processor, arg1_type, arg2_type, arg3_type, arg4_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1, arg2, arg3, arg4 ),
         Allocator() );
     }
@@ -181,15 +214,19 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
+      typedef typename detail::unwrap< Arg2 >::type arg2_type;
+      typedef typename detail::unwrap< Arg3 >::type arg3_type;
+      typedef typename detail::unwrap< Arg4 >::type arg4_type;
+      typedef typename detail::unwrap< Arg5 >::type arg5_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &,
-        const processor_context &,
-        Arg1, Arg2, Arg3, Arg4, Arg5 );
+        const processor_holder_ptr_type &, const processor_context &,
+        arg1_type, arg2_type, arg3_type, arg4_type, arg5_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl5<
-          Processor, Arg1, Arg2, Arg3, Arg4, Arg5 >;
+          Processor, arg1_type, arg2_type, arg3_type, arg4_type, arg5_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1, arg2, arg3, arg4, arg5 ),
         Allocator() );
     }
@@ -203,15 +240,21 @@
     {
       processor_holder_ptr_type pProcessor = make_processor_holder();
       handle = pProcessor;
+      typedef typename detail::unwrap< Arg1 >::type arg1_type;
+      typedef typename detail::unwrap< Arg2 >::type arg2_type;
+      typedef typename detail::unwrap< Arg3 >::type arg3_type;
+      typedef typename detail::unwrap< Arg4 >::type arg4_type;
+      typedef typename detail::unwrap< Arg5 >::type arg5_type;
+      typedef typename detail::unwrap< Arg6 >::type arg6_type;
       typedef void ( processor_container::*impl_fun_ptr )(
-        const processor_holder_ptr_type &,
-        const processor_context &,
-        Arg1, Arg2, Arg3, Arg4, Arg5, Arg6 );
+        const processor_holder_ptr_type &, const processor_context &,
+        arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type );
       impl_fun_ptr pImpl =
         &processor_container::template create_processor_impl6<
-          Processor, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6 >;
+          Processor,
+          arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type >;
       return WorkItem(
-        bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
+        boost::bind( pImpl, this, pProcessor, processor_context( scheduler, handle ),
           arg1, arg2, arg3, arg4, arg5, arg6 ),
         Allocator() );
     }
@@ -219,14 +262,14 @@
     WorkItem destroy_processor( const processor_handle & processor )
     {
       return WorkItem(
-        bind( &processor_container::destroy_processor_impl, this, processor ),
+        boost::bind( &processor_container::destroy_processor_impl, this, processor ),
         Allocator() );
     }
 
     WorkItem initiate_processor( const processor_handle & processor )
     {
       return WorkItem(
-        bind( &processor_container::initiate_processor_impl, this,
+        boost::bind( &processor_container::initiate_processor_impl, this,
           processor ),
         Allocator() );
     }
@@ -234,7 +277,7 @@
     WorkItem terminate_processor( const processor_handle & processor )
     {
       return WorkItem(
-        bind( &processor_container::terminate_processor_impl, this,
+        boost::bind( &processor_container::terminate_processor_impl, this,
           processor ),
         Allocator() );
     }
@@ -247,7 +290,7 @@
       BOOST_ASSERT( pEvent.get() != 0 );
 
       return WorkItem(
-        bind( &processor_container::queue_event_impl, this, processor,
+        boost::bind( &processor_container::queue_event_impl, this, processor,
           pEvent ),
         Allocator() );
     }
@@ -394,7 +437,6 @@
 };
 
 
-
 } // namespace statechart
 } // namespace boost
 
Modified: branches/release/libs/statechart/doc/acknowledgments.html
==============================================================================
--- branches/release/libs/statechart/doc/acknowledgments.html	(original)
+++ branches/release/libs/statechart/doc/acknowledgments.html	2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
@@ -87,18 +87,19 @@
   <p>Bardur Arantsson, Robert Bell, Bohdan, Wayne Chao, Topher Cooper,
   Philippe David, Peter Dimov, Reece Dunn, John Fuller, Jeff Garland, Eugene
   Gladyshev, David A. Greene, Douglas Gregor, Gustavo Guerra, Aleksey
-  Gurtovoy, Federico J. Fernández, Iain K. Hanson, David B. Held,
-  Jürgen Hunold, Sean Kelly, Oliver Kowalke, Simon Meiklejohn, Jiang
-  Miao, Johan Nilsson, Matthieu Paindavoine, Chris Paulse, Yuval Ronen, Chris
-  Russell, Bryan Silverthorn, Rob Stewart, Kwee Heong Tan, Marcin Tustin,
-  Vincent N. Virgilio, Gang Wang, Steven Watanabe and Scott Woods.</p>
+  Gurtovoy, Federico J. Fernández, Iain K. Hanson, Steve Hawkes,
+  David B. Held, Jürgen Hunold, Sean Kelly, Oliver Kowalke, Simon
+  Meiklejohn, Jiang Miao, Johan Nilsson, Matthieu Paindavoine, Chris Paulse,
+  Yuval Ronen, Chris Russell, Bryan Silverthorn, Rob Stewart, Kwee Heong Tan,
+  Marcin Tustin, Vincent N. Virgilio, Gang Wang, Steven Watanabe, Richard
+  Webb and Scott Woods.</p>
   <hr>
 
   <p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
   "../../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
   height="31" width="88"></a></p>
 
-  <p>Revised 05 January, 2008</p>
+  <p>Revised 06 July, 2009</p>
 
   <p><i>Copyright © 2003-2008 <a href="contact.html">Andreas Huber
   Dönni</a></i></p>
Modified: branches/release/libs/statechart/doc/future_and_history.html
==============================================================================
--- branches/release/libs/statechart/doc/future_and_history.html	(original)
+++ branches/release/libs/statechart/doc/future_and_history.html	2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
@@ -140,6 +140,14 @@
 
   <p>(<font color="#FF0000">red</font> = points raised during formal
   review)</p>
+  <p>1.40.0</p>
+  <ul>
+    <li>Fixed a bug that prevented the use of boost::ref() with
+    fifo_scheduler<>::create_processor<>, reported by Steve
+    Hawkes</li>
+    <li>Fixed bug #3092 (regression test failures in VC10 beta 1), reported by
+    Richard Webb</li>
+  </ul>
 
   <p>1.38.0</p>
   <ul>
@@ -695,9 +703,9 @@
   "../../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
   height="31" width="88"></a></p>
 
-  <p>Revised 05 January, 2008</p>
+  <p>Revised 27 June, 2009</p>
 
-  <p><i>Copyright © 2003-2008 <a href="contact.html">Andreas Huber
+  <p><i>Copyright © 2003-2009 <a href="contact.html">Andreas Huber
   Dönni</a></i></p>
 
   <p><i>Distributed under the Boost Software License, Version 1.0. (See
Modified: branches/release/libs/statechart/test/FifoSchedulerTest.cpp
==============================================================================
--- branches/release/libs/statechart/test/FifoSchedulerTest.cpp	(original)
+++ branches/release/libs/statechart/test/FifoSchedulerTest.cpp	2009-07-06 14:35:50 EDT (Mon, 06 Jul 2009)
@@ -160,14 +160,30 @@
   }
 }
 
+static int refArg1;
+static int refArg2;
+static int refArg3;
+static int refArg4;
+static int refArg5;
+static int refArg6;
+
 void Check(
   sc::fifo_scheduler<> & scheduler,
   const sc::fifo_scheduler<>::processor_handle & processor,
   int ctorArgs )
 {
+  refArg1 = 6;
+  refArg2 = 5;
+  refArg3 = 4;
+  refArg4 = 3;
+  refArg5 = 2;
+  refArg6 = 1;
+
   // Make sure the processor has been created
   RunScheduler( scheduler, 1UL );
 
+  refArg1 = refArg2 = refArg3 = refArg4 = refArg5 = refArg6 = 0;
+
   scheduler.initiate_processor( processor );
   // This event triggers the queueing of another event, which itself
   // terminates the machine ...
@@ -209,33 +225,77 @@
   try
   {
     sc::fifo_scheduler<> scheduler;
-    const sc::fifo_scheduler<>::processor_handle processor0 =
-      scheduler.create_processor< FifoSchedulerTest >();
-    Check( scheduler, processor0, 0 );
-
-    const sc::fifo_scheduler<>::processor_handle processor1 =
-      scheduler.create_processor< FifoSchedulerTest >( 1 );
-    Check( scheduler, processor1, 1 );
-
-    const sc::fifo_scheduler<>::processor_handle processor2 =
-      scheduler.create_processor< FifoSchedulerTest >( 1, 2 );
-    Check( scheduler, processor2, 12 );
-
-    const sc::fifo_scheduler<>::processor_handle processor3 =
-      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3 );
-    Check( scheduler, processor3, 123 );
-
-    const sc::fifo_scheduler<>::processor_handle processor4 =
-      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4 );
-    Check( scheduler, processor4, 1234 );
-
-    const sc::fifo_scheduler<>::processor_handle processor5 =
-      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4, 5 );
-    Check( scheduler, processor5, 12345 );
-
-    const sc::fifo_scheduler<>::processor_handle processor6 =
-      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4, 5, 6 );
-    Check( scheduler, processor6, 123456 );
+    Check( scheduler, scheduler.create_processor< FifoSchedulerTest >(), 0 );
+
+    Check(
+      scheduler, scheduler.create_processor< FifoSchedulerTest >( 1 ), 1 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ) ),
+      6 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >( 1, 2 ),
+      12 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ), boost::cref( refArg2 ) ),
+      65 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3 ),
+      123 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ), boost::cref( refArg2 ),
+        boost::cref( refArg3 ) ),
+      654 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4 ),
+      1234 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ), boost::cref( refArg2 ),
+        boost::cref( refArg3 ), boost::cref( refArg4 ) ),
+      6543 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4, 5 ),
+      12345 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ), boost::cref( refArg2 ),
+        boost::cref( refArg3 ), boost::cref( refArg4 ),
+        boost::cref( refArg5 ) ),
+      65432 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >( 1, 2, 3, 4, 5, 6 ),
+      123456 );
+
+    Check(
+      scheduler,
+      scheduler.create_processor< FifoSchedulerTest >(
+        boost::cref( refArg1 ), boost::cref( refArg2 ),
+        boost::cref( refArg3 ), boost::cref( refArg4 ),
+        boost::cref( refArg5 ), boost::cref( refArg6 ) ),
+      654321 );
 
     RunScheduler( scheduler, 0UL );
     bool workItem1Processed = false;