Fawkes API  Fawkes Development Version
fawkes::LockQueue< Type > Class Template Reference

Queue with a lock. More...

#include <>>

Inheritance diagram for fawkes::LockQueue< Type >:

Public Member Functions

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

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 43 of file lock_queue.h.

Constructor & Destructor Documentation

◆ LockQueue() [1/2]

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

Constructor.

Definition at line 97 of file lock_queue.h.

◆ LockQueue() [2/2]

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

Copy constructor.

Parameters
llLockQueue to copy

Definition at line 103 of file lock_queue.h.

◆ ~LockQueue()

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

Destructor.

Definition at line 109 of file lock_queue.h.

Member Function Documentation

◆ clear()

◆ lock()

◆ mutex()

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

Get access to the internal mutex.

Can be used with MutexLocker.

Returns
internal mutex

Definition at line 72 of file lock_queue.h.

Referenced by oprs_protobuf::OpenPRSProtobuf::oprs_pb_events_pending(), and oprs_protobuf::OpenPRSProtobuf::oprs_pb_process().

◆ pop_locked()

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

◆ push_locked()

◆ try_lock()

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 123 of file lock_queue.h.

Referenced by fawkes::LockQueue< ClientData >::try_lock().

◆ unlock()


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