30 #ifndef NODELET_CALLBACK_QUEUE_MANAGER_H 31 #define NODELET_CALLBACK_QUEUE_MANAGER_H 37 #include <boost/shared_ptr.hpp> 38 #include <boost/scoped_array.hpp> 39 #include <boost/unordered_map.hpp> 40 #include <boost/thread/mutex.hpp> 41 #include <boost/thread/thread.hpp> 42 #include <boost/detail/atomic_count.hpp> 76 void addQueue(
const CallbackQueuePtr& queue,
bool threaded);
77 void removeQueue(
const CallbackQueuePtr& queue);
78 void callbackAdded(
const CallbackQueuePtr& queue);
80 uint32_t getNumWorkerThreads();
95 , thread_index(0xffffffff)
110 typedef boost::unordered_map<CallbackQueue*, QueueInfoPtr>
M_Queue;
115 typedef std::vector<CallbackQueuePtr>
V_Queue;
130 std::vector<std::pair<CallbackQueuePtr, QueueInfoPtr> >
queue;
133 #ifdef NODELET_QUEUE_DEBUG 136 Record(
double stamp, uint32_t tasks,
bool threaded)
137 : stamp(stamp), tasks(tasks), threaded(threaded)
145 std::vector<Record> history;
150 static const int ACTUAL_SIZE =
151 sizeof(boost::mutex) +
152 sizeof(boost::condition_variable) +
153 sizeof(std::vector<std::pair<CallbackQueuePtr, QueueInfoPtr> >) +
154 sizeof(boost::detail::atomic_count);
155 uint8_t pad[((ACTUAL_SIZE + 63) & ~63) - ACTUAL_SIZE];
168 #endif // NODELET_CALLBACK_QUEUE_MANAGER_H
boost::detail::atomic_count calling
boost::shared_ptr< QueueInfo > QueueInfoPtr
boost::condition_variable waiting_cond_
boost::condition_variable queue_cond
boost::shared_ptr< CallbackQueue > CallbackQueuePtr
boost::unordered_map< CallbackQueue *, QueueInfoPtr > M_Queue
boost::scoped_array< ThreadInfo > V_ThreadInfo
uint32_t num_worker_threads_
V_ThreadInfo thread_info_
std::vector< CallbackQueuePtr > V_Queue
std::vector< std::pair< CallbackQueuePtr, QueueInfoPtr > > queue
boost::mutex waiting_mutex_
boost::mutex queues_mutex_