cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ref Class Reference

#include <CCRef.h>

Inheritance diagram for Ref:
ActionTimelineData __Array __Bool __Dictionary __Double __Float __Integer __NotificationCenter __Set __String Acceleration Action ActionManager Animation Animation3D AnimationCache AnimationCurve< componentSize > AnimationFrame Bone3D BundleReader Component Configuration Console Director Event EventDispatcher EventListener AudioEngineImpl AudioEngineImpl AudioEngineImpl AssetsManagerEx Color3bObject Invocation Manifest Font FontAtlas GLProgram GLProgramCache GLProgramState GLView Grabber GridBase GroupCommandManager Image IndexBuffer LuaStack Mesh MeshIndexData MeshSkin MeshVertexData HttpRequest HttpResponse SIOClient Node NotificationObserver PhysicsBody PhysicsShape PointArray Primitive Profiler ProfilingTimer ScheduleHandlerDelegate Scheduler Skeleton3D SpriteFrame SpriteFrameCache Texture2D TextureAtlas TextureCache Timer TMXLayerInfo TMXMapInfo TMXObjectGroup TMXTilesetInfo Touch LayoutManager LayoutParameter RichElement VertexBuffer VertexData CCBAnimationManager CCBKeyframe CCBReader CCBSequence CCBSequenceProperty NodeLoader NodeLoaderLibrary ActionFrame ActionFrameEasing ActionManagerEx ActionNode ActionObject AnimationData ArmatureData ArmatureDataManager ArmatureMovementDispatcher BaseData BaseTriggerAction BaseTriggerCondition ColliderBody ColliderDetector ComAudioReader ContourData DataReaderHelper DecorativeDisplay DisplayData DisplayManager GameMapReader GUIReader MovementBoneData MovementData NodeReader ParticleReader ProcessBase ProjectNodeReader SingleNodeReader SpriteReader TextureData TriggerObj WidgetPropertiesReader WidgetReader Frame LuaMinXmlHttpRequest PolygonBatch Timeline

Public Member Functions

void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Protected Member Functions

 Ref ()
 Constructor. More...
 

Protected Attributes

unsigned int _referenceCount
 count of references More...
 

Friends

class AutoreleasePool

Constructor & Destructor Documentation

Ref ( )
protected

Constructor.

The Ref's reference count is 1 after construction.

virtual ~Ref ( )
virtual

Member Function Documentation

Ref* autorelease ( )

Releases the ownership sometime soon automatically.

This descrements the Ref's reference count at the end of current autorelease pool block.

If the reference count reaches 0 after the descrement, this Ref is destructed.

Returns
The Ref itself.
See also
AutoreleasePool, retain, release
unsigned int getReferenceCount ( ) const

Returns the Ref's current reference count.

Returns
The Ref's reference count.
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.

See also
retain, autorelease
void retain ( )

Retains the ownership.

This increases the Ref's reference count.

See also
release, autorelease

Friends And Related Function Documentation

friend class AutoreleasePool
friend

Member Data Documentation

unsigned int _referenceCount
protected

count of references


The documentation for this class was generated from the following file: