Go to the documentation of this file.
69 std::lock_guard<std::mutex> lock(
m_csQueue);
82 std::lock_guard<std::mutex> lock(
m_csQueue);
92 std::lock_guard<std::mutex> lock(
m_csQueue);
111 std::lock_guard<std::mutex> lock(
m_csQueue);
131 std::lock_guard<std::mutex> lock(
m_csQueue);
138 std::lock_guard<std::mutex> lock(
m_csQueue);
T * get()
Retrieve the next message in the queue, or nullptr if there is no message.
size_t size() const
Return the number of queued messages.
std::mutex m_csQueue
The critical section.
virtual ~CThreadSafeQueue()
std::queue< T * > m_msgs
The queue of messages.
bool empty() const
Return true if there are no messages.
void push(T *msg)
Insert a new message in the queue - The object must be created with "new", and do not delete is after...
void clear()
Clear the queue of messages, freeing memory as required.
CThreadSafeQueue()=default
Default ctor.
T * get_lastest_purge_old()
Skip all old messages in the queue and directly return the last one (the most recent,...
A thread-safe template queue for object passing between threads; for a template argument of T,...
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020 | |