Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
LockVector () | |
Constructor. | |
LockVector (const LockVector< Type > &lv) | |
Copy constructor. | |
virtual | ~LockVector () |
Destructor. | |
virtual void | lock () const |
Lock vector. | |
virtual bool | try_lock () const |
Try to lock vector. | |
virtual void | unlock () const |
Unlock vector. | |
RefPtr< Mutex > | mutex () const |
Get access to the internal mutex. | |
void | push_back_locked (const Type &x) |
Push element to vector at back with lock protection. | |
void | pop_back_locked () |
Remove last element with lock protection. | |
void | erase_locked (typename std::vector< Type >::iterator pos) |
Erase given element with lock protection. | |
void | erase_locked (typename std::vector< Type >::iterator first, typename std::vector< Type >::iterator last) |
Erase given element range with lock protection. | |
LockVector< Type > & | operator= (const LockVector< Type > &lv) |
Copy values from another LockVector. | |
LockVector< Type > & | operator= (const std::vector< Type > &v) |
Copy values from a standard vector. |
Vector with a lock.
This class provides a vector that has an intrinsic lock. The lock can be applied with the regular locking methods.
fawkes::LockVector::LockVector | ( | ) |
Constructor.
Definition at line 75 of file lock_vector.h.
fawkes::LockVector::LockVector | ( | const LockVector< Type > & | lv | ) |
fawkes::LockVector::~LockVector | ( | ) | [virtual] |
Destructor.
Definition at line 91 of file lock_vector.h.
void fawkes::LockVector::erase_locked | ( | typename std::vector< Type >::iterator | pos | ) |
Erase given element with lock protection.
pos | iterator for the object position to remove |
Definition at line 153 of file lock_vector.h.
void fawkes::LockVector::erase_locked | ( | typename std::vector< Type >::iterator | first, |
typename std::vector< Type >::iterator | last | ||
) |
Erase given element range with lock protection.
first | iterator to first element to erase |
last | iterator to first element not to erase |
Definition at line 166 of file lock_vector.h.
void fawkes::LockVector::lock | ( | ) | const [virtual] |
Lock vector.
Definition at line 98 of file lock_vector.h.
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 181 of file lock_vector.h.
LockVector< Type > & fawkes::LockVector::operator= | ( | const LockVector< Type > & | lv | ) |
Copy values from another LockVector.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
lv | vector to copy |
Definition at line 195 of file lock_vector.h.
LockVector< Type > & fawkes::LockVector::operator= | ( | const std::vector< Type > & | v | ) |
Copy values from a standard vector.
Copies the values one by one. This instance is locked during the copying and cleared.
v | vector to copy |
Definition at line 219 of file lock_vector.h.
void fawkes::LockVector::pop_back_locked | ( | ) |
Remove last element with lock protection.
Definition at line 140 of file lock_vector.h.
void fawkes::LockVector::push_back_locked | ( | const Type & | x | ) |
Push element to vector at back with lock protection.
x | element to add |
Definition at line 129 of file lock_vector.h.
bool fawkes::LockVector::try_lock | ( | ) | const [virtual] |
Try to lock vector.
Definition at line 109 of file lock_vector.h.
void fawkes::LockVector::unlock | ( | ) | const [virtual] |
Unlock vector.
Definition at line 118 of file lock_vector.h.