35 #ifndef ROSCPP_CALLBACK_QUEUE_H 36 #define ROSCPP_CALLBACK_QUEUE_H 41 #ifdef BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC 42 #include <boost/version.hpp> 43 #if BOOST_VERSION < 106100 46 #else // Boost version is 1.61 or greater and has the steady clock fixes 47 #include <boost/thread/condition_variable.hpp> 49 #else // !BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC 50 #include <boost/thread/condition_variable.hpp> 51 #endif // BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC 57 #include <boost/shared_ptr.hpp> 58 #include <boost/thread/mutex.hpp> 59 #include <boost/thread/shared_mutex.hpp> 60 #include <boost/thread/tss.hpp> 78 virtual void removeByID(uint64_t removal_id);
163 IDInfoPtr getIDInfo(uint64_t
id);
169 , marked_for_removal(false)
188 : calling_in_this_thread(0xffffffffffffffffULL)
189 , cb_it(callbacks.end())
195 boost::thread_specific_ptr<TLS>
tls_;
boost::thread_specific_ptr< TLS > tls_
D_CallbackInfo::iterator cb_it
bool empty()
returns whether or not the queue is empty
This is the default implementation of the ros::CallbackQueueInterface.
boost::shared_mutex calling_rw_mutex
CallOneResult callOne()
Pop a single callback off the front of the queue and invoke it. If the callback was not ready to be c...
Abstract interface for a queue used to handle all callbacks within roscpp.
std::map< uint64_t, IDInfoPtr > M_IDInfo
D_CallbackInfo callbacks_
boost::shared_ptr< IDInfo > IDInfoPtr
boost::shared_ptr< CallbackQueue > CallbackQueuePtr
void callAvailable()
Invoke all callbacks currently in the queue. If a callback was not ready to be called, pushes it back onto the queue.
boost::mutex id_info_mutex_
std::list< CallbackInfo > L_CallbackInfo
uint64_t calling_in_this_thread
boost::condition_variable condition_
CallbackInterfacePtr callback
std::deque< CallbackInfo > D_CallbackInfo