27 #ifndef GOBY_ACOMMS_CONNECT_H
28 #define GOBY_ACOMMS_CONNECT_H
30 #include <boost/bind/bind.hpp>
31 #include <boost/signals2.hpp>
38 template <
typename Signal,
typename Slot>
void connect(Signal* signal, Slot slot)
40 signal->connect(slot);
44 template <
typename Signal,
typename Obj,
typename A1>
45 void connect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1))
51 template <
typename Signal,
typename Obj,
typename A1,
typename A2>
52 void connect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1, A2))
54 connect(signal,
boost::bind(mem_func, obj, boost::placeholders::_1, boost::placeholders::_2));
58 template <
typename Signal,
typename Obj,
typename A1,
typename A2,
typename A3>
59 void connect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1, A2, A3))
61 connect(signal,
boost::bind(mem_func, obj, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3));
65 template <
typename Signal,
typename Slot>
void disconnect(Signal* signal, Slot slot)
67 signal->disconnect(slot);
71 template <
typename Signal,
typename Obj,
typename A1>
72 void disconnect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1))
78 template <
typename Signal,
typename Obj,
typename A1,
typename A2>
79 void disconnect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1, A2))
85 template <
typename Signal,
typename Obj,
typename A1,
typename A2,
typename A3>
86 void disconnect(Signal* signal, Obj* obj,
void (Obj::*mem_func)(A1, A2, A3))
88 disconnect(signal,
boost::bind(mem_func, obj, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3));