fawkes::LockQueue< Type > Class Template Reference
[Fawkes Core Library]

Queue with a lock. More...

#include <core/utils/lock_queue.h>

Inheritance diagram for fawkes::LockQueue< Type >:

[legend]
List of all members.

Public Member Functions

 LockQueue ()
 Constructor.
 LockQueue (const LockQueue< Type > &ll)
 Copy constructor.
virtual ~LockQueue ()
 Destructor.
void lock () const
 Lock queue.
bool try_lock () const
 Try to lock queue.
void unlock () const
 Unlock list.
RefPtr< Mutexmutex () const
 Get access to the internal mutex.
void push_locked (const Type &x)
 Push element to queue with lock protection.
void pop_locked ()
 Pop element from queue with lock protection.
void clear ()
 Clear the queue.

Detailed Description

template<typename Type>
class fawkes::LockQueue< Type >

Queue with a lock.

This class provides a queue that has an intrinsic lock. The lock can be applied with the regular locking methods.

See also:
Mutex
Author:
Tim Niemueller

Definition at line 34 of file lock_queue.h.


Constructor & Destructor Documentation

template<typename Type>
fawkes::LockQueue< Type >::LockQueue (  ) 

Constructor.

Definition at line 72 of file lock_queue.h.

template<typename Type>
fawkes::LockQueue< Type >::LockQueue ( const LockQueue< Type > &  ll  ) 

Copy constructor.

Parameters:
ll LockQueue to copy

Definition at line 81 of file lock_queue.h.

template<typename Type>
fawkes::LockQueue< Type >::~LockQueue (  )  [virtual]

Destructor.

Definition at line 88 of file lock_queue.h.


Member Function Documentation

template<typename Type>
void fawkes::LockQueue< Type >::clear (  ) 

Clear the queue.

Definition at line 148 of file lock_queue.h.

Referenced by FuseTransferWidget::FuseTransferWidget(), and BBLoggerThread::init().

template<typename Type>
void fawkes::LockQueue< Type >::lock (  )  const

Lock queue.

Definition at line 95 of file lock_queue.h.

Referenced by fawkes::FawkesNetworkServerThread::loop(), firevision::FuseClient::loop(), fawkes::FawkesNetworkTransceiver::recv(), fawkes::FawkesNetworkClientRecvThread::recv(), firevision::FuseNetworkTransceiver::recv(), fawkes::FawkesNetworkTransceiver::send(), and firevision::FuseNetworkTransceiver::send().

template<typename Type>
RefPtr< Mutex > fawkes::LockQueue< Type >::mutex (  )  const

Get access to the internal mutex.

Can be used with MutexLocker.

Returns:
internal mutex

Definition at line 164 of file lock_queue.h.

template<typename Type>
void fawkes::LockQueue< Type >::pop_locked (  ) 

Pop element from queue with lock protection.

Definition at line 138 of file lock_queue.h.

template<typename Type>
void fawkes::LockQueue< Type >::push_locked ( const Type &  x  ) 

Push element to queue with lock protection.

Parameters:
x element to add

Definition at line 126 of file lock_queue.h.

Referenced by fawkes::FawkesNetworkServerThread::dispatch(), firevision::FuseClient::enqueue(), firevision::FuseClient::enqueue_and_wait(), FuseTransferWidget::fuse_connection_died(), fawkes::AvahiThread::unwatch_service(), fawkes::AvahiThread::watch_service(), and FuseTransferWidget::~FuseTransferWidget().

template<typename Type>
bool fawkes::LockQueue< Type >::try_lock (  )  const

Try to lock queue.

Returns:
true, if the lock has been aquired, false otherwise.

Definition at line 106 of file lock_queue.h.

template<typename Type>
void fawkes::LockQueue< Type >::unlock (  )  const

Unlock list.

Definition at line 115 of file lock_queue.h.

Referenced by fawkes::FawkesNetworkServerThread::loop(), firevision::FuseClient::loop(), fawkes::FawkesNetworkTransceiver::recv(), fawkes::FawkesNetworkClientRecvThread::recv(), firevision::FuseNetworkTransceiver::recv(), fawkes::FawkesNetworkTransceiver::send(), and firevision::FuseNetworkTransceiver::send().


The documentation for this class was generated from the following file:
Generated on Tue Feb 22 13:31:39 2011 for Fawkes API by  doxygen 1.4.7