1 // A thread-safe version of Boost.Signals. 2 3 // Copyright Frank Mori Hess 2007-2009 4 // 5 // Use, modification and 6 // distribution is subject to the Boost Software License, Version 7 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt) 9 10 // For more information, see http://www.boost.org 11 12 #ifndef BOOST_SIGNALS2_SIGNAL_HPP 13 #define BOOST_SIGNALS2_SIGNAL_HPP 14 15 #include <algorithm> 16 #include <boost/assert.hpp> 17 #include <boost/config.hpp> 18 #include <boost/function.hpp> 19 #include <boost/mpl/identity.hpp> 20 #include <boost/noncopyable.hpp> 21 #include <boost/shared_ptr.hpp> 22 #include <boost/signals2/connection.hpp> 23 #include <boost/signals2/detail/unique_lock.hpp> 24 #include <boost/signals2/detail/replace_slot_function.hpp> 25 #include <boost/signals2/detail/result_type_wrapper.hpp> 26 #include <boost/signals2/detail/signals_common.hpp> 27 #include <boost/signals2/detail/signals_common_macros.hpp> 28 #include <boost/signals2/detail/slot_groups.hpp> 29 #include <boost/signals2/detail/slot_call_iterator.hpp> 30 #include <boost/signals2/optional_last_value.hpp> 31 #include <boost/signals2/mutex.hpp> 32 #include <boost/signals2/slot.hpp> 33 #include <functional> 34 35 #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES 36 #include <boost/signals2/preprocessed_signal.hpp> 37 #else 38 #include <boost/signals2/variadic_signal.hpp> 39 #endif 40 41 namespace boost 42 { 43 namespace signals2 44 { 45 // free swap function, findable by ADL 46 template<typename Signature, 47 typename Combiner, 48 typename Group, 49 typename GroupCompare, 50 typename SlotFunction, 51 typename ExtendedSlotFunction, 52 typename Mutex> swap(signal<Signature,Combiner,Group,GroupCompare,SlotFunction,ExtendedSlotFunction,Mutex> & sig1,signal<Signature,Combiner,Group,GroupCompare,SlotFunction,ExtendedSlotFunction,Mutex> & sig2)53 void swap( 54 signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig1, 55 signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig2) 56 { 57 sig1.swap(sig2); 58 } 59 } 60 } 61 62 #endif // BOOST_SIGNALS2_SIGNAL_HPP 63