26 #include <com/avpkit/ferry/RefCounted.h>
27 namespace com {
namespace avpkit {
namespace ferry
104 reset(
static_cast<T*
>(rPtr.mPtr));
105 VS_REF_ACQUIRE(mPtr);
118 reset(
static_cast<T*
>(rPtr.mPtr));
119 VS_REF_ACQUIRE(mPtr);
156 return static_cast<T*
>(mPtr);
192 int refCount = mPtr->getCurrentRefCount();
193 assert(refCount >= 1);
197 VS_REF_RELEASE(mPtr);
208 VS_REF_ACQUIRE(mPtr);
209 return static_cast<T*
>(mPtr);
228 return static_cast<T*
>(mPtr);
237 void reset(T* ptr=0,
bool acquire=
false)
239 VS_REF_RELEASE(mPtr);
242 VS_REF_ACQUIRE(mPtr);
This class is only useful from C++.
T * operator->() const
Allow people to def-ref the RefPointer() without RefCounted::acquire() the managed pointer.
RefPointer(T *ptr)
Construct a RefPointer from a RefCounted object, and take over management of the ref-count this point...
T * get()
Call RefCounted::acquire() on the managed pointer and return it.
RefPointer & operator=(T *ptr)
Assignment from a RefCounted* where we take over ownership of the refcount.
T * value()
Return the managed pointer without calling RefCounted::acquire() on it.
RefPointer(const RefPointer &rPtr)
Copy another RefPointer object.
RefPointer(RefPointer &rPtr)
Copy and acquire.
RefPointer()
Default constructor; sets the managed pointer to 0.
RefPointer & operator=(RefPointer &rPtr)
Assignment operator to copy another ref pointer.
virtual ~RefPointer()
Always release the ref-count of our underlying pointer.
RefPointer & operator=(const RefPointer &rPtr)
Assignment operator to copy another ref pointer.
void reset(T *ptr=0, bool acquire=false)
Reset the managed pointer, calling RefCounted::release() on the previously managed pointer first.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...