1 /*************************************************************************** 2 * Mechanized Assault and Exploration Reloaded Projectfile * 3 * * 4 * This program is free software; you can redistribute it and/or modify * 5 * it under the terms of the GNU General Public License as published by * 6 * the Free Software Foundation; either version 2 of the License, or * 7 * (at your option) any later version. * 8 * * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 * GNU General Public License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License * 15 * along with this program; if not, write to the * 16 * Free Software Foundation, Inc., * 17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 ***************************************************************************/ 19 20 #ifndef utility_signal_slotH 21 #define utility_signal_slotH 22 23 #include <functional> 24 25 class cSignalConnection; 26 27 template<typename F> 28 class cSlot 29 { 30 public: 31 template<typename F2, typename M, typename C> 32 friend class cSignal; 33 34 typedef std::function<F> function_type; 35 cSlot(cSignalConnection connection_,function_type function_)36 cSlot (cSignalConnection connection_, function_type function_) : 37 connection (std::move (connection_)), 38 function (std::move (function_)), 39 disconnected (false) 40 {} 41 42 cSignalConnection connection; 43 function_type function; 44 bool disconnected; 45 }; 46 47 #endif // utility_signal_slotH 48