ucc::auto_protect Class Reference
A mutex locked object smart pointer helper class.
More...
#include <thread.h>
Detailed Description
A mutex locked object smart pointer helper class.
This is particularly useful in referencing objects which will be protected by the mutex protect function. When the pointer falls out of scope, the protecting mutex is also released. This is meant to be used by the typed mutex_pointer template.
- Author:
- David Sugar <dyfet@gnutelephony.org>
Definition at line 1257 of file thread.h.
Constructor & Destructor Documentation
ucc::auto_protect::auto_protect |
( |
void * |
object |
) |
|
Construct a protected pointer referencing an existing object.
- Parameters:
-
ucc::auto_protect::~auto_protect |
( |
|
) |
|
Delete protected pointer.
When it falls out of scope the associated mutex is released.
Member Function Documentation
ucc::auto_protect::operator bool |
( |
|
) |
const [inline] |
Test if the pointer is referencing an object.
- Returns:
- true if the pointer is currently referencing an object.
Definition at line 1297 of file thread.h.
bool ucc::auto_protect::operator! |
( |
|
) |
const [inline] |
Test if the pointer is not set.
- Returns:
- true if the pointer is not referencing anything.
Definition at line 1290 of file thread.h.
void ucc::auto_protect::operator= |
( |
void * |
object |
) |
|
Set our pointer to a specific object.
If the pointer currently references another object, the associated mutex is released. The pointer references our new object and that new object is locked.
- Parameters:
-
void ucc::auto_protect::release |
( |
void |
|
) |
|
The documentation for this class was generated from the following file: