Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53359 - in trunk: boost/signals2 boost/signals2/detail libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-05-28 15:44:45


Author: fmhess
Date: 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
New Revision: 53359
URL: http://svn.boost.org/trac/boost/changeset/53359

Log:
Added signature_type member typedef to variadic signal implementation.
Also added it to slot classes.

Text files modified:
   trunk/boost/signals2/detail/signal_template.hpp | 1 +
   trunk/boost/signals2/detail/slot_template.hpp | 1 +
   trunk/boost/signals2/preprocessed_slot.hpp | 1 +
   trunk/boost/signals2/slot.hpp | 2 +-
   trunk/boost/signals2/variadic_signal.hpp | 1 +
   trunk/boost/signals2/variadic_slot.hpp | 1 +
   trunk/libs/signals2/test/signal_test.cpp | 3 +++
   7 files changed, 9 insertions(+), 1 deletions(-)

Modified: trunk/boost/signals2/detail/signal_template.hpp
==============================================================================
--- trunk/boost/signals2/detail/signal_template.hpp (original)
+++ trunk/boost/signals2/detail/signal_template.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -565,6 +565,7 @@
         typedef typename detail::variadic_arg_type<n, Args...>::type type;
       };
       BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
+ typedef typename mpl::identity<R (Args...)>::type signature_type;
 
 #endif // BOOST_NO_VARIADIC_TEMPLATES
 

Modified: trunk/boost/signals2/detail/slot_template.hpp
==============================================================================
--- trunk/boost/signals2/detail/slot_template.hpp (original)
+++ trunk/boost/signals2/detail/slot_template.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -69,6 +69,7 @@
         typedef typename detail::variadic_arg_type<n, Args...>::type type;
       };
       BOOST_STATIC_CONSTANT(int, arity = detail::vararg_count<Args...>::value);
+ typedef typename mpl::identity<R (Args...)>::type signature_type;
 
 #endif // BOOST_NO_VARIADIC_TEMPLATES
 

Modified: trunk/boost/signals2/preprocessed_slot.hpp
==============================================================================
--- trunk/boost/signals2/preprocessed_slot.hpp (original)
+++ trunk/boost/signals2/preprocessed_slot.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -53,6 +53,7 @@
       typedef typename detail::slotN<boost::function_traits<Signature>::arity,
         Signature, SlotFunction>::type base_type;
     public:
+ typedef Signature signature_type;
       template<typename F>
       slot(const F& f): base_type(f)
       {}

Modified: trunk/boost/signals2/slot.hpp
==============================================================================
--- trunk/boost/signals2/slot.hpp (original)
+++ trunk/boost/signals2/slot.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -1,6 +1,6 @@
 // Boost.Signals2 library
 
-// Copyright Frank Mori Hess 2007-2008.
+// Copyright Frank Mori Hess 2009.
 //
 // Use, modification and
 // distribution is subject to the Boost Software License, Version

Modified: trunk/boost/signals2/variadic_signal.hpp
==============================================================================
--- trunk/boost/signals2/variadic_signal.hpp (original)
+++ trunk/boost/signals2/variadic_signal.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -16,6 +16,7 @@
 #ifndef BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 #define BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
 
+#include <boost/mpl/identity.hpp>
 #include <boost/signals2/detail/variadic_arg_type.hpp>
 #include <boost/signals2/detail/variadic_slot_invoker.hpp>
 #include <boost/type_traits/function_traits.hpp>

Modified: trunk/boost/signals2/variadic_slot.hpp
==============================================================================
--- trunk/boost/signals2/variadic_slot.hpp (original)
+++ trunk/boost/signals2/variadic_slot.hpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -11,6 +11,7 @@
 #ifndef BOOST_SIGNALS2_VARIADIC_SLOT_HPP
 #define BOOST_SIGNALS2_VARIADIC_SLOT_HPP
 
+#include <boost/mpl/identity.hpp>
 #include <boost/signals2/detail/variadic_arg_type.hpp>
 
 #define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \

Modified: trunk/libs/signals2/test/signal_test.cpp
==============================================================================
--- trunk/libs/signals2/test/signal_test.cpp (original)
+++ trunk/libs/signals2/test/signal_test.cpp 2009-05-28 15:44:44 EDT (Thu, 28 May 2009)
@@ -15,6 +15,7 @@
 #include <boost/signals2.hpp>
 #include <functional>
 #include <iostream>
+#include <typeinfo>
 
 template<typename T>
 struct max_or_default {
@@ -245,11 +246,13 @@
   BOOST_CHECK(typeid(signal_type::result_type) == typeid(boost::optional<int>));
   BOOST_CHECK(typeid(signal_type::arg<0>::type) == typeid(double));
   BOOST_CHECK(typeid(signal_type::arg<1>::type) == typeid(long));
+ BOOST_CHECK(typeid(signal_type::signature_type) == typeid(int (double, long)));
   BOOST_CHECK(signal_type::arity == 2);
 
   BOOST_CHECK(typeid(slot_type::result_type) == typeid(signal_type::slot_result_type));
   BOOST_CHECK(typeid(slot_type::arg<0>::type) == typeid(signal_type::arg<0>::type));
   BOOST_CHECK(typeid(slot_type::arg<1>::type) == typeid(signal_type::arg<1>::type));
+ BOOST_CHECK(typeid(slot_type::signature_type) == typeid(signal_type::signature_type));
   BOOST_CHECK(slot_type::arity == signal_type::arity);
 }
 


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