3 // Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
15 // You should have received a copy of the GNU Library General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef SG_FUNCTION_LIST_HXX_
20 #define SG_FUNCTION_LIST_HXX_
22 #include <boost/function.hpp>
23 #include <boost/preprocessor/iteration/iterate.hpp>
24 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
25 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
26 #include <boost/utility/enable_if.hpp>
31 template<typename Sig> class function_list;
33 // Build dependency for CMake, gcc, etc.
34 # define SG_DONT_DO_ANYTHING
35 # include <simgear/structure/detail/function_list_template.hxx>
36 # undef SG_DONT_DO_ANYTHING
38 # define BOOST_PP_ITERATION_LIMITS (0, 3)
39 # define BOOST_PP_FILENAME_1 <simgear/structure/detail/function_list_template.hxx>
40 # include BOOST_PP_ITERATE()
43 * Handle a list of callbacks like a single boost::function.
45 * @tparam Sig Function signature.
47 template<typename Sig>
48 class function_list<boost::function<Sig> >:
49 public function_list<Sig>
54 } // namespace simgear
56 #endif /* SG_FUNCTION_LIST_HXX_ */