Fawkes API
Fawkes Development Version
|
List with a read/write lock. More...
#include <>>
Public Member Functions | |
RWLockList () | |
Constructor. More... | |
RWLockList (const RWLockList< Type > &ll) | |
Copy constructor. More... | |
virtual | ~RWLockList () |
Destructor. More... | |
virtual void | lock_for_read () |
Lock list for reading. More... | |
virtual void | lock_for_write () |
Lock list for writing. More... | |
virtual bool | try_lock_for_read () |
Try to lock list for reading. More... | |
virtual bool | try_lock_for_write () |
Try to lock list for writing. More... | |
virtual void | unlock () |
Unlock list. More... | |
RefPtr< ReadWriteLock > | rwlock () const |
Get access to the internal read/write lock. 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... | |
RWLockList< Type > & | operator= (const RWLockList< Type > &ll) |
Copy values from another RWLockList. More... | |
RWLockList< Type > & | operator= (const std::list< Type > &l) |
Copy values from a standard list. More... | |
List with a read/write lock.
This class provides a list that has an intrinsic lock. The lock can be applied with the regular locking methods.
Definition at line 35 of file rwlock_list.h.
fawkes::RWLockList< Type >::RWLockList | ( | ) |
Constructor.
Definition at line 73 of file rwlock_list.h.
fawkes::RWLockList< Type >::RWLockList | ( | const RWLockList< Type > & | ll | ) |
|
virtual |
Destructor.
Definition at line 89 of file rwlock_list.h.
|
virtual |
Lock list for reading.
Definition at line 96 of file rwlock_list.h.
Referenced by fawkes::RWLockList< Type >::operator=().
|
virtual |
Lock list for writing.
Definition at line 105 of file rwlock_list.h.
RWLockList< Type > & fawkes::RWLockList< Type >::operator= | ( | const RWLockList< Type > & | ll | ) |
Copy values from another RWLockList.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
ll | list to copy |
Definition at line 200 of file rwlock_list.h.
References fawkes::RWLockList< Type >::lock_for_read(), and fawkes::RWLockList< Type >::unlock().
RWLockList< Type > & fawkes::RWLockList< Type >::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.
l | list to copy |
Definition at line 224 of file rwlock_list.h.
void fawkes::RWLockList< Type >::push_back_locked | ( | const Type & | x | ) |
Push element to list at back with lock protection.
x | element to add |
Definition at line 147 of file rwlock_list.h.
void fawkes::RWLockList< Type >::push_front_locked | ( | const Type & | x | ) |
Push element to list at front with lock protection.
x | element to add |
Definition at line 160 of file rwlock_list.h.
void fawkes::RWLockList< Type >::remove_locked | ( | const Type & | x | ) |
Remove element from list with lock protection.
x | element to remove |
Definition at line 173 of file rwlock_list.h.
RefPtr< ReadWriteLock > fawkes::RWLockList< Type >::rwlock | ( | ) | const |
Get access to the internal read/write lock.
Definition at line 186 of file rwlock_list.h.
|
virtual |
Try to lock list for reading.
Definition at line 116 of file rwlock_list.h.
|
virtual |
Try to lock list for writing.
Definition at line 127 of file rwlock_list.h.
|
virtual |
Unlock list.
Definition at line 136 of file rwlock_list.h.
Referenced by fawkes::RWLockList< Type >::operator=().