Fawkes API  Fawkes Development Version
fawkes::LockList Class Reference

#include <>>

Inheritance diagram for fawkes::LockList:

Public Member Functions

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

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

Definition at line 43 of file thread.h.

Constructor & Destructor Documentation

◆ LockList() [1/2]

fawkes::LockList::LockList ( )

Constructor.

Definition at line 119 of file lock_list.h.

◆ LockList() [2/2]

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

Copy constructor.

Parameters
llLockList to copy

Definition at line 124 of file lock_list.h.

◆ ~LockList()

virtual fawkes::LockList::~LockList ( )
inlinevirtual

Destructor.

Definition at line 62 of file lock_list.h.

Member Function Documentation

◆ lock()

◆ mutex()

◆ operator=() [1/2]

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 185 of file lock_list.h.

Referenced by fawkes::ThreadList::~ThreadList().

◆ operator=() [2/2]

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 202 of file lock_list.h.

◆ push_back_locked()

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 151 of file lock_list.h.

Referenced by fawkes::ConfigNetworkHandler::loop().

◆ push_front_locked()

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 160 of file lock_list.h.

◆ remove_locked()

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

Remove element from list with lock protection.

Parameters
xelement to remove

Definition at line 169 of file lock_list.h.

Referenced by fawkes::PluginNetworkHandler::client_connected(), and fawkes::NetworkLogger::client_connected().

◆ try_lock()

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

Try to lock list.

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

Definition at line 137 of file lock_list.h.

Referenced by fawkes::LockList< Mapping::Ptr >::lock().

◆ unlock()


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