Wrapper for pointer with automatic destruction and mutiple references. More...
#include <Thread.h>
Public Member Functions | |
T & | operator* (void) const |
T * | operator-> (void) const |
operator bool (void) const | |
bool | operator! (void) const |
bool | operator== (const ThreadedPointer &p) const |
bool | operator!= (const ThreadedPointer &p) const |
bool | operator< (const ThreadedPointer &p) const |
T * | Ptr (void) const |
T * | Release (void) |
unsigned int | Holders (void) |
unsigned int | WaitOutRange (unsigned int minThr, unsigned int maxThr) |
unsigned int | WaitOutRange (unsigned int minThr, unsigned int maxThr, int timeout) |
unsigned int | WaitInRange (unsigned int minThr, unsigned int maxThr) |
unsigned int | WaitInRange (unsigned int minThr, unsigned int maxThr, int timeout) |
Wrapper for pointer with automatic destruction and mutiple references.
See for CountedPointer for description. Differently from CountedPointer this class provides thread safe destruction of refered object. But the instance of ThreadedPointer itself is not thread safe. Hence it is advisable to use different instances in different threads.
T* Arc::ThreadedPointer< T >::Release | ( | void | ) | [inline] |
Release refered object so that it can be passed to other container.
After Release() is called refered object is will not be destroyed automatically anymore.
unsigned int Arc::ThreadedPointer< T >::WaitInRange | ( | unsigned int | minThr, | |
unsigned int | maxThr, | |||
int | timeout | |||
) | [inline] |
Waits till number of ThreadedPointer instances >= minThr and <= maxThr.
Waits no longer than timeout milliseconds. If timeout is negative - wait forever. Returns current number of instances.
unsigned int Arc::ThreadedPointer< T >::WaitOutRange | ( | unsigned int | minThr, | |
unsigned int | maxThr, | |||
int | timeout | |||
) | [inline] |
Waits till number of ThreadedPointer instances <= minThr or >= maxThr.
Waits no longer than timeout milliseconds. If timeout is negative - wait forever. Returns current number of instances.