Ref is used for reference count manangement. More...
#include <CCRef.h>
Public Member Functions | |
| void | retain () |
| Retains the ownership. More... | |
| void | release () |
| Releases the ownership immediately. More... | |
| Ref * | autorelease () |
| Releases the ownership sometime soon automatically. More... | |
| unsigned int | getReferenceCount () const |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. More... | |
Protected Member Functions | |
| Ref () | |
| Constructor. More... | |
| Ref () | |
| Constructor. More... | |
Protected Attributes | |
| unsigned int | _referenceCount |
| count of references More... | |
| local | _referenceCount |
| count of references More... | |
Friends | |
| class | AutoreleasePool |
Ref is used for reference count manangement.
If a class inherits from Ref, then it is easy to be shared in different places.
|
virtual |
Destructor.
| Ref* autorelease | ( | ) |
| unsigned int getReferenceCount | ( | ) | const |
| local getReferenceCount | ( | ) |
| void release | ( | ) |
Releases the ownership immediately.
This decrements the Ref's reference count.
If the reference count reaches 0 after the descrement, this Ref is destructed.
| local release | ( | ) |
Releases the ownership immediately.
This decrements the Ref's reference count.
If the reference count reaches 0 after the descrement, this Ref is destructed.
| void retain | ( | ) |
| local retain | ( | ) |
|
friend |
|
friend |
|
protected |
count of references
|
protected |
count of references