Fawkes API  Fawkes Development Version
fawkes::LockQueue Class Reference

Queue with a lock. More...

#include <core/utils/lock_queue.h>

Inheritance diagram for fawkes::LockQueue:

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

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

Constructor & Destructor Documentation

fawkes::LockQueue::LockQueue ( )

Constructor.

Definition at line 72 of file lock_queue.h.

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

Copy constructor.

Parameters:
llLockQueue to copy

Definition at line 81 of file lock_queue.h.

fawkes::LockQueue::~LockQueue ( ) [virtual]

Destructor.

Definition at line 88 of file lock_queue.h.


Member Function Documentation

void fawkes::LockQueue::clear ( void  )
RefPtr< Mutex > fawkes::LockQueue::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.

void fawkes::LockQueue::pop_locked ( )

Pop element from queue with lock protection.

Definition at line 138 of file lock_queue.h.

Referenced by fawkes::BlackBoardNetworkHandler::loop(), fawkes::PluginNetworkHandler::loop(), and fawkes::ConfigNetworkHandler::loop().

bool fawkes::LockQueue::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.


The documentation for this class was generated from the following file: