#import <tobject.h>
Inheritance diagram for TObject:
Public Member Functions | |
(id) | - init |
(id) | - free |
(int) | - grab |
Increases the reference count of the object by one. | |
(int) | - release |
Decreases the reference count of the object by one. | |
(int) | - get_refcount |
Returns the current reference count of this object. | |
(int) | - get_id |
Returns the unique ID of this Object. | |
Protected Attributes | |
unsigned int | ID |
Unique ID assigned at creation. | |
int | refcount |
The current reference count of the object. |
TObject implements reference counting for objects. It is recommended that only these methods be used for memory management on TObject classes and its derivatives.
All TObject classes and its derivatives manage their own memory. For example, if you pass it a character pointer, you can free it independent of the class as it makes its own copy and frees it as it needs to. Note that in get methods the pointer returned is NOT A COPY, SO YOU MAY NOT FREE IT!
Definition at line 37 of file tobject.h.
|
Increases the reference count of the object by one. Returns the new count. Definition at line 45 of file tobject.m. References refcount. |
|
Decreases the reference count of the object by one. Returns the new count. Definition at line 50 of file tobject.m. References free, and refcount. Referenced by TCharacter::free. |