1 /*
2   A thread-safe version of Boost.Signals.
3 
4   Author: Frank Mori Hess <fmhess@users.sourceforge.net>
5   Begin: 2007-01-23
6 */
7 // Copyright Frank Mori Hess 2007-2008
8 // Use, modification and
9 // distribution is subject to the Boost Software License, Version
10 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
12 
13 // For more information, see http://www.boost.org
14 
15 #ifndef BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
16 #define BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
17 
18 #include <boost/config.hpp>
19 #include <boost/preprocessor/arithmetic.hpp>
20 #include <boost/preprocessor/cat.hpp>
21 #include <boost/preprocessor/control/expr_if.hpp>
22 #include <boost/preprocessor/iteration.hpp>
23 #include <boost/preprocessor/repetition.hpp>
24 #include <boost/signals2/detail/preprocessed_arg_type.hpp>
25 #include <boost/type_traits/add_reference.hpp>
26 #include <boost/type_traits/is_void.hpp>
27 #include <boost/utility/enable_if.hpp>
28 
29 #define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS2_MAX_ARGS)
30 #define BOOST_PP_FILENAME_1 <boost/signals2/detail/signal_template.hpp>
31 #include BOOST_PP_ITERATE()
32 
33 namespace boost
34 {
35   namespace signals2
36   {
37     template<typename Signature,
38       typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>,
39       typename Group = int,
40       typename GroupCompare = std::less<Group>,
41       typename SlotFunction = function<Signature>,
42       typename ExtendedSlotFunction = typename detail::extended_signature<function_traits<Signature>::arity, Signature>::function_type,
43       typename Mutex = mutex >
44     class signal: public detail::signalN<function_traits<Signature>::arity,
45       Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type
46     {
47     private:
48       typedef typename detail::signalN<boost::function_traits<Signature>::arity,
49         Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type base_type;
50     public:
signal(const Combiner & combiner_arg=Combiner (),const GroupCompare & group_compare=GroupCompare ())51       signal(const Combiner &combiner_arg = Combiner(), const GroupCompare &group_compare = GroupCompare()):
52         base_type(combiner_arg, group_compare)
53       {}
54 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && BOOST_WORKAROUND(BOOST_MSVC, < 1800)
signal(signal && other)55       signal(signal && other) BOOST_NOEXCEPT: base_type(std::move(other)) {}
operator =(signal && other)56       signal & operator=(signal && other) BOOST_NOEXCEPT{ base_type::operator=(std::move(other)); return *this; }
57 #endif
58     };
59   }
60 }
61 
62 #endif // BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
63