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>
68 virtual void call(
bool nonconst_force_copy,
const M0Event& e0,
const M1Event& e1,
const M2Event& e2,
const M3Event& e3,
69 const M4Event& e4,
const M5Event& e5,
const M6Event& e6,
const M7Event& e7,
const M8Event& e8) = 0;
74 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8>
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>
116 virtual void call(
bool nonconst_force_copy,
const M0Event& e0,
const M1Event& e1,
const M2Event& e2,
const M3Event& e3,
117 const M4Event& e4,
const M5Event& e5,
const M6Event& e6,
const M7Event& e7,
const M8Event& e8)
128 callback_(A0::getParameter(e0),
129 A1::getParameter(e1),
130 A2::getParameter(e2),
131 A3::getParameter(e3),
132 A4::getParameter(e4),
133 A5::getParameter(e5),
134 A6::getParameter(e6),
135 A7::getParameter(e7),
136 A8::getParameter(e8));
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_);
176 callbacks_.push_back(CallbackHelper9Ptr(helper));
180 template<
typename P0,
typename P1>
183 return addCallback(boost::function<
void(P0, P1, NullP, NullP, NullP, NullP, NullP, NullP, NullP)>(boost::bind(callback, _1, _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, _1, _2, _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, _1, _2, _3, _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, _1, _2, _3, _4, _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, _1, _2, _3, _4, _5, _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, _1, _2, _3, _4, _5, _6, _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, _1, _2, _3, _4, _5, _6, _7, _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, _1, _2, _3, _4, _5, _6, _7, _8, _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, _1, _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, _1, _2, _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, _1, _2, _3, _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, _1, _2, _3, _4, _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, _1, _2, _3, _4, _5, _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, _1, _2, _3, _4, _5, _6, _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, _1, _2, _3, _4, _5, _6, _7, _8)));
273 return addCallback<
const M0ConstPtr&,
281 const M8ConstPtr&>(boost::bind(callback, _1, _2, _3, _4, _5, _6, _7, _8, _9));
286 boost::mutex::scoped_lock lock(mutex_);
287 typename V_CallbackHelper9::iterator it = std::find(callbacks_.begin(), callbacks_.end(), helper);
288 if (it != callbacks_.end())
290 callbacks_.erase(it);
294 void call(
const M0Event& e0,
const M1Event& e1,
const M2Event& e2,
const M3Event& e3,
const M4Event& e4,
295 const M5Event& e5,
const M6Event& e6,
const M7Event& e7,
const M8Event& e8)
297 boost::mutex::scoped_lock lock(mutex_);
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)
303 const CallbackHelper9Ptr& helper = *it;
304 helper->call(nonconst_force_copy, e0, e1, e2, e3, e4, e5, e6, e7, e8);
315 #endif // MESSAGE_FILTERS_SIGNAL9_H Connection addCallback(void(T::*callback)(P0, P1, P2, P3, P4, P5, P6, P7), T *t)
boost::shared_ptr< M7 const > M7ConstPtr
CallbackHelper9T(const Callback &cb)
virtual ~CallbackHelper9()
ros::MessageEvent< M8 const > M8Event
Connection addCallback(void(*callback)(P0, P1, P2))
ParameterAdapter< P5 > A5
bool nonConstWillCopy() const
ros::MessageEvent< M3 const > M3Event
Connection addCallback(void(T::*callback)(P0, P1, P2, P3, P4, P5, P6), T *t)
void call(const M0Event &e0, const M1Event &e1, const M2Event &e2, const M3Event &e3, const M4Event &e4, const M5Event &e5, const M6Event &e6, const M7Event &e7, const M8Event &e8)
Connection addCallback(void(*callback)(P0, P1, P2, P3, P4, P5, P6, P7))
ros::MessageEvent< M5 const > M5Event
ros::MessageEvent< M2 const > M2Event
boost::shared_ptr< M8 const > M8ConstPtr
ros::MessageEvent< M1 const > M1Event
boost::shared_ptr< M0 const > M0ConstPtr
Connection addCallback(void(T::*callback)(P0, P1), T *t)
Connection addCallback(void(*callback)(P0, P1, P2, P3, P4, P5))
ros::MessageEvent< M2 const > M2Event
ros::MessageEvent< M6 const > M6Event
ParameterAdapter< P3 > A3
ParameterAdapter< P2 > A2
virtual void call(bool nonconst_force_copy, const M0Event &e0, const M1Event &e1, const M2Event &e2, const M3Event &e3, const M4Event &e4, const M5Event &e5, const M6Event &e6, const M7Event &e7, const M8Event &e8)
Connection addCallback(void(*callback)(P0, P1))
const boost::shared_ptr< NullType const > & NullP
ros::MessageEvent< M6 const > M6Event
Connection addCallback(void(T::*callback)(P0, P1, P2), T *t)
std::vector< CallbackHelper9Ptr > V_CallbackHelper9
ParameterAdapter< P0 > A0
Connection addCallback(void(T::*callback)(P0, P1, P2, P3), T *t)
boost::function< void(typename A0::Parameter, typename A1::Parameter, typename A2::Parameter, typename A3::Parameter, typename A4::Parameter, typename A5::Parameter, typename A6::Parameter, typename A7::Parameter, typename A8::Parameter)> Callback
boost::shared_ptr< M6 const > M6ConstPtr
boost::shared_ptr< CallbackHelper9 > Ptr
V_CallbackHelper9 callbacks_
boost::shared_ptr< M5 const > M5ConstPtr
Connection addCallback(void(*callback)(P0, P1, P2, P3, P4, P5, P6, P7, P8))
ros::MessageEvent< M3 const > M3Event
Connection addCallback(void(*callback)(P0, P1, P2, P3))
ParameterAdapter< P6 > A6
ros::MessageEvent< M8 const > M8Event
ros::MessageEvent< M1 const > M1Event
ros::MessageEvent< M4 const > M4Event
Connection addCallback(void(T::*callback)(P0, P1, P2, P3, P4, P5), T *t)
ParameterAdapter< P7 > A7
boost::shared_ptr< M4 const > M4ConstPtr
boost::shared_ptr< M3 const > M3ConstPtr
ros::MessageEvent< M7 const > M7Event
boost::shared_ptr< M2 const > M2ConstPtr
Connection addCallback(void(T::*callback)(P0, P1, P2, P3, P4), T *t)
ParameterAdapter< P8 > A8
boost::shared_ptr< CallbackHelper9< M0, M1, M2, M3, M4, M5, M6, M7, M8 > > CallbackHelper9Ptr
ParameterAdapter< P1 > A1
ros::MessageEvent< M4 const > M4Event
Connection addCallback(void(*callback)(P0, P1, P2, P3, P4, P5, P6))
ros::MessageEvent< M0 const > M0Event
ros::MessageEvent< M7 const > M7Event
Connection addCallback(const boost::function< void(P0, P1, P2, P3, P4, P5, P6, P7, P8)> &callback)
boost::shared_ptr< M1 const > M1ConstPtr
ParameterAdapter< P4 > A4
Encapsulates a connection from one filter to another (or to a user-specified callback) ...
ros::MessageEvent< M0 const > M0Event
Connection addCallback(C &callback)
virtual void call(bool nonconst_force_copy, const M0Event &e0, const M1Event &e1, const M2Event &e2, const M3Event &e3, const M4Event &e4, const M5Event &e5, const M6Event &e6, const M7Event &e7, const M8Event &e8)=0
void removeCallback(const CallbackHelper9Ptr &helper)
ros::MessageEvent< M5 const > M5Event
Connection addCallback(void(*callback)(P0, P1, P2, P3, P4))