Ref is used for reference count manangement. More...
Inherited by Acceleration, Action, ActionManager, Animation, Animation3D, AnimationCache, AnimationCurve< componentSize >, AnimationFrame, Bone3D, BundleReader, Configuration, Director, Event, EventDispatcher, EventListener, GLProgram, GLProgramCache, GLProgramState, GLView, Grabber, GridBase, GroupCommandManager, IndexBuffer, LuaStack, Mesh, MeshIndexData, MeshSkin, MeshVertexData, HttpRequest, HttpResponse, SIOClient, Node, PhysicsBody, PhysicsShape, PointArray, Primitive, Scheduler, ScriptHandlerEntry, Skeleton3D, SpriteFrame, SpriteFrameCache, SpritePolygonCache, Texture2D, TextureAtlas, TextureCache, TMXObjectGroup, Touch, LayoutManager, LayoutParameter, RichElement, VertexBuffer, and VertexData.
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... | |
Public Attributes | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID | |
| int | _luaID |
| Lua reference id. | |
| void * | _scriptObject |
| scriptObject, support for swift | |
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.
| void retain | ( | ) |
| local retain | ( | ) |
| 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.
| Ref* autorelease | ( | ) |
| unsigned int getReferenceCount | ( | ) | const |
| local getReferenceCount | ( | ) |