template<typename T, typename M = std::recursive_mutex, int N = 100>
class cptr< T, M, N >
cptr models a concurrent pointer with locks.
In its current implementation takes advantage of the drill down behaviour of the arrow operator and returns a proxy object. That object is returned only once the associated lock has been obtained. The proxy can be dereferenced and returns the pointer to the actual holded object. The lock is released when the proxy object is destroyed.
Usage:
Myclass * p = new Myclass;
In any thread :
cptr<Myclass> cp(p);
cp->dosomething();
Definition at line 49 of file cptr.hpp.