35 #ifndef MESSAGE_FILTERS_SIGNAL9_H
36 #define MESSAGE_FILTERS_SIGNAL9_H
38 #include <boost/noncopyable.hpp>
45 #include <boost/bind.hpp>
46 #include <boost/thread/mutex.hpp>
52 template<
typename M0,
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
typename M6,
typename M7,
typename M8>
74 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
75 class CallbackHelper9T :
76 public CallbackHelper9<typename ParameterAdapter<P0>::Message,
77 typename ParameterAdapter<P1>::Message,
78 typename ParameterAdapter<P2>::Message,
79 typename ParameterAdapter<P3>::Message,
80 typename ParameterAdapter<P4>::Message,
81 typename ParameterAdapter<P5>::Message,
82 typename ParameterAdapter<P6>::Message,
83 typename ParameterAdapter<P7>::Message,
84 typename ParameterAdapter<P8>::Message>
119 M0Event my_e0(e0, nonconst_force_copy || e0.nonConstWillCopy());
120 M1Event my_e1(e1, nonconst_force_copy || e0.nonConstWillCopy());
121 M2Event my_e2(e2, nonconst_force_copy || e0.nonConstWillCopy());
122 M3Event my_e3(e3, nonconst_force_copy || e0.nonConstWillCopy());
123 M4Event my_e4(e4, nonconst_force_copy || e0.nonConstWillCopy());
124 M5Event my_e5(e5, nonconst_force_copy || e0.nonConstWillCopy());
125 M6Event my_e6(e6, nonconst_force_copy || e0.nonConstWillCopy());
126 M7Event my_e7(e7, nonconst_force_copy || e0.nonConstWillCopy());
127 M8Event my_e8(e8, nonconst_force_copy || e0.nonConstWillCopy());
143 template<
typename M0,
typename M1,
typename M2,
typename M3,
typename M4,
typename M5,
typename M6,
typename M7,
typename M8>
170 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
173 CallbackHelper9T<P0, P1, P2, P3, P4, P5, P6, P7, P8>* helper =
new CallbackHelper9T<P0, P1, P2, P3, P4, P5, P6, P7, P8>(callback);
175 boost::mutex::scoped_lock lock(
mutex_);
180 template<
typename P0,
typename P1>
183 return addCallback(boost::function<
void(P0, P1,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2)));
186 template<
typename P0,
typename P1,
typename P2>
189 return addCallback(boost::function<
void(P0, P1, P2,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3)));
192 template<
typename P0,
typename P1,
typename P2,
typename P3>
195 return addCallback(boost::function<
void(P0, P1, P2, P3,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4)));
198 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4>
201 return addCallback(boost::function<
void(P0, P1, P2, P3, P4,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5)));
204 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
207 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5,
NullP,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6)));
210 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
213 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5, P6,
NullP,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7)));
216 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
219 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5, P6, P7,
NullP)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7, boost::placeholders::_8)));
222 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
225 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5, P6, P7, P8)>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7, boost::placeholders::_8, boost::placeholders::_9)));
228 template<
typename T,
typename P0,
typename P1>
231 return addCallback(boost::function<
void(P0, P1,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2)));
234 template<
typename T,
typename P0,
typename P1,
typename P2>
237 return addCallback(boost::function<
void(P0, P1, P2,
NullP,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3)));
240 template<
typename T,
typename P0,
typename P1,
typename P2,
typename P3>
243 return addCallback(boost::function<
void(P0, P1, P2, P3,
NullP,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4)));
246 template<
typename T,
typename P0,
typename P1,
typename P2,
typename P3,
typename P4>
249 return addCallback(boost::function<
void(P0, P1, P2, P3, P4,
NullP,
NullP,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5)));
252 template<
typename T,
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
255 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5,
NullP,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6)));
258 template<
typename T,
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
261 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5, P6,
NullP,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7)));
264 template<
typename T,
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
267 return addCallback(boost::function<
void(P0, P1, P2, P3, P4, P5, P6, P7,
NullP)>(boost::bind(callback, t, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7, boost::placeholders::_8)));
281 const M8ConstPtr&>(boost::bind(callback, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3, boost::placeholders::_4, boost::placeholders::_5, boost::placeholders::_6, boost::placeholders::_7, boost::placeholders::_8, boost::placeholders::_9));
286 boost::mutex::scoped_lock lock(
mutex_);
287 typename V_CallbackHelper9::iterator it = std::find(
callbacks_.begin(),
callbacks_.end(), helper);
298 bool nonconst_force_copy =
callbacks_.size() > 1;
299 typename V_CallbackHelper9::iterator it =
callbacks_.begin();
300 typename V_CallbackHelper9::iterator end =
callbacks_.end();
301 for (; it != end; ++it)
304 helper->call(nonconst_force_copy, e0, e1, e2, e3, e4, e5, e6, e7, e8);
315 #endif // MESSAGE_FILTERS_SIGNAL9_H