Arc::ThreadedPointer< T > Class Template Reference

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)

Detailed Description

template<typename T>
class Arc::ThreadedPointer< T >

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.


Member Function Documentation

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

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

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


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:22 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3