GG
SignalsAndSlots.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /* GG is a GUI for SDL and OpenGL.
3  Copyright (C) 2003-2008 T. Zachary Laine
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public License
7  as published by the Free Software Foundation; either version 2.1
8  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  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18  02111-1307 USA
19 
20  If you do not wish to comply with the terms of the LGPL please
21  contact the author as other terms are available for a fee.
22 
23  Zach Laine
24  whatwasthataddress@gmail.com */
25 
26 #ifndef _GG_SignalsAndSlots_h_
27 #define _GG_SignalsAndSlots_h_
28 
29 #include <boost/bind.hpp>
30 #include <boost/preprocessor/cat.hpp>
31 
32 #include <GG/Signal0.h>
33 #include <GG/Signal1.h>
34 #include <GG/Signal2.h>
35 #include <GG/Signal3.h>
36 #include <GG/Signal4.h>
37 #include <GG/Signal5.h>
38 #include <GG/Signal6.h>
39 #include <GG/Signal7.h>
40 #include <GG/Signal8.h>
41 
45 namespace GG {
46 
50 template <class SigT> inline
51 boost::signals::connection
52 Connect(SigT& sig, const typename SigT::slot_type& _slot, boost::signals::connect_position at = boost::signals::at_back)
53 {
54  return sig.connect(_slot, at);
55 }
56 
60 template <class SigT> inline
61 boost::signals::connection
62 Connect(SigT& sig, const typename SigT::slot_type& _slot, int grp, boost::signals::connect_position at = boost::signals::at_back)
63 {
64  return sig.connect(grp, _slot, at);
65 }
66 
67 } // namespace GG
68 
69 
70 #endif
71 
72