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

Queue with a read/write lock. More...

#include <core/utils/rwlock_queue.h>

Inheritance diagram for fawkes::RWLockQueue< Type >:

[legend]
List of all members.

Public Member Functions

 RWLockQueue ()
 Constructor.
 RWLockQueue (const RWLockQueue< Type > &ll)
 Copy constructor.
virtual ~RWLockQueue ()
 Destructor.
void lock_for_read ()
 Lock queue for reading.
void lock_for_write ()
 Lock queue for writing.
bool try_lock_for_read ()
 Try to lock queue for reading.
bool try_lock_for_write ()
 Try to lock queue for writing.
void unlock ()
 Unlock list.
RefPtr< ReadWriteLockrwlock () const
 Get access to the internal rwlock.
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::RWLockQueue< Type >

Queue with a read/write lock.

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

See also:
ReadWriteLock
Author:
Tim Niemueller

Definition at line 35 of file rwlock_queue.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 75 of file rwlock_queue.h.

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

Copy constructor.

Parameters:
ll RWLockQueue to copy

Definition at line 85 of file rwlock_queue.h.

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

Destructor.

Definition at line 94 of file rwlock_queue.h.


Member Function Documentation

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

Clear the queue.

Definition at line 177 of file rwlock_queue.h.

template<typename Type>
void fawkes::RWLockQueue< Type >::lock_for_read (  ) 

Lock queue for reading.

Definition at line 103 of file rwlock_queue.h.

template<typename Type>
void fawkes::RWLockQueue< Type >::lock_for_write (  ) 

Lock queue for writing.

Definition at line 112 of file rwlock_queue.h.

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

Pop element from queue with lock protection.

Definition at line 166 of file rwlock_queue.h.

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

Push element to queue with lock protection.

Parameters:
x element to add

Definition at line 154 of file rwlock_queue.h.

template<typename Type>
ReadWriteLock * fawkes::RWLockQueue< Type >::rwlock (  )  const

Get access to the internal rwlock.

Can be used with RwlockLocker.

Returns:
internal rwlock

Definition at line 193 of file rwlock_queue.h.

template<typename Type>
bool fawkes::RWLockQueue< Type >::try_lock_for_read (  ) 

Try to lock queue for reading.

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

Definition at line 123 of file rwlock_queue.h.

template<typename Type>
bool fawkes::RWLockQueue< Type >::try_lock_for_write (  ) 

Try to lock queue for writing.

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

Definition at line 134 of file rwlock_queue.h.

template<typename Type>
void fawkes::RWLockQueue< Type >::unlock (  ) 

Unlock list.

Definition at line 143 of file rwlock_queue.h.


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