A thread-safe template queue for object passing between threads, with objects being passed being "T*".
Definition at line 43 of file CThreadSafeQueue.h.
#include <mrpt/utils/CThreadSafeQueue.h>
Public Member Functions | |
CThreadSafeQueue () | |
virtual | ~CThreadSafeQueue () |
void | clear () |
void | push (T *msg) |
T * | get () |
Retrieve the next message in the queue, or NULL if there is no message. | |
bool | empty () const |
< Return true if there are no messages. | |
Protected Attributes | |
std::queue< T * > | m_msgs |
The queue of messages. Memory is freed at destructor or by clients gathering messages. | |
mrpt::synch::CCriticalSection | m_csQueue |
The critical section. |
mrpt::utils::CThreadSafeQueue< T >::CThreadSafeQueue | ( | ) | [inline] |
Definition at line 49 of file CThreadSafeQueue.h.
virtual mrpt::utils::CThreadSafeQueue< T >::~CThreadSafeQueue | ( | ) | [inline, virtual] |
Definition at line 53 of file CThreadSafeQueue.h.
void mrpt::utils::CThreadSafeQueue< T >::clear | ( | void | ) | [inline] |
Definition at line 58 of file CThreadSafeQueue.h.
Referenced by mrpt::utils::CThreadSafeQueue< CMessage >::~CThreadSafeQueue().
bool mrpt::utils::CThreadSafeQueue< T >::empty | ( | ) | const [inline] |
< Return true if there are no messages.
Definition at line 90 of file CThreadSafeQueue.h.
T* mrpt::utils::CThreadSafeQueue< T >::get | ( | ) | [inline] |
Retrieve the next message in the queue, or NULL if there is no message.
The user MUST call "delete" with the returned object after use.
Definition at line 77 of file CThreadSafeQueue.h.
void mrpt::utils::CThreadSafeQueue< T >::push | ( | T * | msg ) | [inline] |
msg | Insert a new message in the queue - The object must be created with "new", and do not delete is after calling this, it must be deleted later. |
Definition at line 68 of file CThreadSafeQueue.h.
mrpt::synch::CCriticalSection mrpt::utils::CThreadSafeQueue< T >::m_csQueue [protected] |
The critical section.
Definition at line 47 of file CThreadSafeQueue.h.
Referenced by mrpt::utils::CThreadSafeQueue< CMessage >::clear(), mrpt::utils::CThreadSafeQueue< CMessage >::empty(), mrpt::utils::CThreadSafeQueue< CMessage >::get(), and mrpt::utils::CThreadSafeQueue< CMessage >::push().
std::queue<T*> mrpt::utils::CThreadSafeQueue< T >::m_msgs [protected] |
The queue of messages. Memory is freed at destructor or by clients gathering messages.
Definition at line 46 of file CThreadSafeQueue.h.
Referenced by mrpt::utils::CThreadSafeQueue< CMessage >::clear(), mrpt::utils::CThreadSafeQueue< CMessage >::empty(), mrpt::utils::CThreadSafeQueue< CMessage >::get(), and mrpt::utils::CThreadSafeQueue< CMessage >::push().
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011 |