Files | |
file | IotrRefCount.h |
file | SmartPointer.h |
Compounds | |
class | IotrRefCount |
class | SmartPointer |
Functions | |
template<class T> void | IotrRelease (T **obj) |
template<class T> void | IotrAddRef (T *const *obj) |
template<class T> void | SpNil (SmartPointer< T > &sp) |
template<class T> void | SpReferTo (SmartPointer< T > &sp, T *obj) |
template<class T> T * | SpAsPointer (SmartPointer< T > &sp) |
void | release (IotrRefCount **obj) |
void | addRef (IotrRefCount *const *obj) |
|
Increment the reference count of this object: it is more convenient to call the template function IotrAddRef(). The parameter obj contains the address of a pointer of type exactly (IotrRefCount *). In other words it can't be a pointer to an instance of a subclass. IotrAddRef() does not have this restriction.
|
|
Increments the reference count of obj. Objects are only deleted when their reference count becomes zero, so this call must be balanced by a call to IotrRelease to decrement the reference count when this object is no longer needed.
|
|
Release a reference to an object. If the number of references to obj becomes zero, delete the object.
|
|
Release this reference to obj: it is more convenient to call the template function IotrRelease(). The parameter obj contains the address of a pointer of type exactly (IotrRefCount *). In other words it can't be a pointer to an instance of a subclass. IotrRelease() does not have this restriction.
|
|
Call SpAsPointer instead; returns a traditional pointer to the underlying object. This pointer has its reference count incremented so that it will continue to exist after the SmartPointer goes out of scope. Use this method to return a pointer to the object, or to create a new traditional pointer reference to the object |
|
Set a SmartPointer to nil. |
|
Make a SmartPointer refer to the same object as a traditional pointer. The reference count is incremented. Use this function to keep a reference to a parameter of a routine. |