Fawkes API  Fawkes Development Version
fawkes::LockList Class Reference

List with a lock. More...

#include <>>

Inheritance diagram for fawkes::LockList:

List of all members.

Public Member Functions

 LockList ()
 Constructor.
 LockList (const LockList< Type > &ll)
 Copy constructor.
virtual ~LockList ()
 Destructor.
virtual void lock () const
 Lock list.
virtual bool try_lock () const
 Try to lock list.
virtual void unlock () const
 Unlock list.
RefPtr< Mutexmutex () const
 Get access to the internal mutex.
void push_back_locked (const Type &x)
 Push element to list at back with lock protection.
void push_front_locked (const Type &x)
 Push element to list at front with lock protection.
void remove_locked (const Type &x)
 Remove element from list with lock protection.
LockList< Type > & operator= (const LockList< Type > &ll)
 Copy values from another LockList.
LockList< Type > & operator= (const std::list< Type > &l)
 Copy values from a standard list.

Detailed Description

List with a lock.

This class provides a list 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::LockList::LockList ( )

Constructor.

Definition at line 115 of file lock_list.h.

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

Copy constructor.

Parameters:
llLockList to copy

Definition at line 121 of file lock_list.h.

virtual fawkes::LockList::~LockList ( ) [inline, virtual]

Destructor.

Definition at line 56 of file lock_list.h.


Member Function Documentation

void fawkes::LockList::lock ( ) const [virtual]
RefPtr< Mutex > fawkes::LockList::mutex ( ) const

Get access to the internal mutex.

Can be used with MutexLocker.

Returns:
internal mutex

Definition at line 182 of file lock_list.h.

Referenced by LaserPointCloudThread::loop().

LockList< Type > & fawkes::LockList::operator= ( const LockList< Type > &  ll)

Copy values from another LockList.

Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.

Parameters:
lllist to copy
Returns:
reference to this instance

Definition at line 190 of file lock_list.h.

LockList< Type > & fawkes::LockList::operator= ( const std::list< Type > &  l)

Copy values from a standard list.

Copies the values one by one. This instance is locked during the copying and cleared.

Parameters:
llist to copy
Returns:
reference to this instance

Definition at line 208 of file lock_list.h.

void fawkes::LockList::push_back_locked ( const Type &  x)

Push element to list at back with lock protection.

Parameters:
xelement to add

Definition at line 152 of file lock_list.h.

Referenced by fawkes::ConfigNetworkHandler::loop(), fawkes::Thread::add_notification_listener(), fawkes::FileAlterationMonitor::add_filter(), and fawkes::FileAlterationMonitor::add_listener().

void fawkes::LockList::push_front_locked ( const Type &  x)

Push element to list at front with lock protection.

Parameters:
xelement to add

Definition at line 162 of file lock_list.h.

bool fawkes::LockList::try_lock ( ) const [virtual]

Try to lock list.

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

Definition at line 136 of file lock_list.h.

void fawkes::LockList::unlock ( ) const [virtual]

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