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

#include <>>

Inheritance diagram for fawkes::RWLockList< Type >:

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< ReadWriteLockrwlock () 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...
 

Detailed Description

template<typename Type>
class fawkes::RWLockList< Type >

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.

See also
ReadWriteLock
Author
Tim Niemueller

Definition at line 39 of file rwlock_list.h.

Constructor & Destructor Documentation

◆ RWLockList() [1/2]

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

Constructor.

Definition at line 75 of file rwlock_list.h.

◆ RWLockList() [2/2]

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

Copy constructor.

Parameters
llRWLockList to copy

Definition at line 83 of file rwlock_list.h.

◆ ~RWLockList()

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

Destructor.

Definition at line 90 of file rwlock_list.h.

Member Function Documentation

◆ lock_for_read()

template<typename Type >
void fawkes::RWLockList< Type >::lock_for_read ( )
virtual

Lock list for reading.

Definition at line 97 of file rwlock_list.h.

◆ lock_for_write()

template<typename Type >
void fawkes::RWLockList< Type >::lock_for_write ( )
virtual

Lock list for writing.

Definition at line 105 of file rwlock_list.h.

◆ operator=() [1/2]

template<typename Type >
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.

Parameters
lllist to copy
Returns
reference to this instance

Definition at line 192 of file rwlock_list.h.

◆ operator=() [2/2]

template<typename Type >
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.

Parameters
llist to copy
Returns
reference to this instance

Definition at line 215 of file rwlock_list.h.

◆ push_back_locked()

template<typename Type >
void fawkes::RWLockList< Type >::push_back_locked ( const Type &  x)

Push element to list at back with lock protection.

Parameters
xelement to add

Definition at line 143 of file rwlock_list.h.

◆ push_front_locked()

template<typename Type >
void fawkes::RWLockList< Type >::push_front_locked ( const Type &  x)

Push element to list at front with lock protection.

Parameters
xelement to add

Definition at line 155 of file rwlock_list.h.

◆ remove_locked()

template<typename Type >
void fawkes::RWLockList< Type >::remove_locked ( const Type &  x)

Remove element from list with lock protection.

Parameters
xelement to remove

Definition at line 167 of file rwlock_list.h.

◆ rwlock()

template<typename Type >
RefPtr< ReadWriteLock > fawkes::RWLockList< Type >::rwlock ( ) const

Get access to the internal read/write lock.

Returns
internal rwlock

Definition at line 179 of file rwlock_list.h.

◆ try_lock_for_read()

template<typename Type >
bool fawkes::RWLockList< Type >::try_lock_for_read ( )
virtual

Try to lock list for reading.

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

Definition at line 115 of file rwlock_list.h.

◆ try_lock_for_write()

template<typename Type >
bool fawkes::RWLockList< Type >::try_lock_for_write ( )
virtual

Try to lock list for writing.

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

Definition at line 125 of file rwlock_list.h.

◆ unlock()

template<typename Type >
void fawkes::RWLockList< Type >::unlock ( )
virtual

Unlock list.

Definition at line 133 of file rwlock_list.h.


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