]> git.mxchange.org Git - simgear.git/blob - simgear/structure/function_list.hxx
canvas::Layout: support for contents margins.
[simgear.git] / simgear / structure / function_list.hxx
1 ///@file Handle a list of callbacks like a single boost::function
2 //
3 // Copyright (C) 2014  Thomas Geymayer <tomgey@gmail.com>
4 //
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.
9 //
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.
14 //
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
18
19 #ifndef SG_FUNCTION_LIST_HXX_
20 #define SG_FUNCTION_LIST_HXX_
21
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>
27 #include <vector>
28
29 namespace simgear
30 {
31   template<typename Sig> class function_list;
32
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
37
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()
41
42   template<typename Sig>
43   class function_list<boost::function<Sig> >:
44     public function_list<Sig>
45   {
46
47   };
48
49 } // namespace simgear
50
51 #endif /* SG_FUNCTION_LIST_HXX_ */