preprocessed_signal.hpp 2.0 KB

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