<html> <head> <title>Cal3D: cal3d::RefCounted Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center"> <tr> <td class="md" align="center"> <small> <b>- Cal3D 0.11 API Reference -</b> </small> </td> </tr> </table> <br> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><b>cal3d</b>::<a class="el" href="classcal3d_1_1RefCounted.html">RefCounted</a> </div> </div> <div class="contents"> <h1>cal3d::RefCounted Class Reference</h1><!-- doxytag: class="cal3d::RefCounted" -->Derive from <a class="el" href="classcal3d_1_1RefCounted.html" title="Derive from RefCounted to make your class have reference-counted lifetime semantics...">RefCounted</a> to make your class have reference-counted lifetime semantics. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="refcounted_8h_source.html">refcounted.h</a>></code> <p> Inherited by CalCoreAnimation, CalCoreMaterial, CalCoreMesh, and CalCoreSkeleton. <p> <p> <a href="classcal3d_1_1RefCounted-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="78133d0b4fd0a8ea09462777df74face"></a><!-- doxytag: member="cal3d::RefCounted::getRefCount" ref="78133d0b4fd0a8ea09462777df74face" args="() const " --> int </td><td class="memItemRight" valign="bottom"><b>getRefCount</b> () const </td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classcal3d_1_1RefCounted.html#9cf6ab695ca641a9781b4aa1d331d5ea">~RefCounted</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Protected so users of refcounted classes don't use std::auto_ptr or the delete operator. <a href="#9cf6ab695ca641a9781b4aa1d331d5ea"></a><br></td></tr> <tr><td colspan="2"><br><h2>Friends</h2></td></tr> <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="9ae56c9af912d690b31244b3af51d712"></a><!-- doxytag: member="cal3d::RefCounted::explicitIncRef" ref="9ae56c9af912d690b31244b3af51d712" args="(T *p)" --> template<typename T > </td></tr> <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">T * </td><td class="memTemplItemRight" valign="bottom"><b>explicitIncRef</b> (T *p)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fd75b7b52c87365caffe64d9c76dbb2a"></a><!-- doxytag: member="cal3d::RefCounted::explicitDecRef" ref="fd75b7b52c87365caffe64d9c76dbb2a" args="(RefCounted *p)" --> void </td><td class="memItemRight" valign="bottom"><b>explicitDecRef</b> (<a class="el" href="classcal3d_1_1RefCounted.html">RefCounted</a> *p)</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Derive from <a class="el" href="classcal3d_1_1RefCounted.html" title="Derive from RefCounted to make your class have reference-counted lifetime semantics...">RefCounted</a> to make your class have reference-counted lifetime semantics. <p> Use <a class="el" href="classcal3d_1_1RefPtr.html" title="A container-safe smart pointer used for refcounted classes.">RefPtr</a> to manage references. (Don't call incRef() or decRef() directly.) When deriving from <a class="el" href="classcal3d_1_1RefCounted.html" title="Derive from RefCounted to make your class have reference-counted lifetime semantics...">RefCounted</a>, make your destructor protected so manual deletion won't happen on accident.<p> Note: The reference count is initialized to 0. This makes sense, because, at object construction, no RefPtrs have referenced the object. However, this can cause trouble if you (indirectly) make a <a class="el" href="classcal3d_1_1RefPtr.html" title="A container-safe smart pointer used for refcounted classes.">RefPtr</a> to 'this' within your constructor. When the refptr goes out of scope, the count goes back to 0, and the object is deleted before it even exits the constructor. Current recommended solution: Don't make refptrs to 'this'. Pass 'this' by raw pointer and such. <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="9cf6ab695ca641a9781b4aa1d331d5ea"></a><!-- doxytag: member="cal3d::RefCounted::~RefCounted" ref="9cf6ab695ca641a9781b4aa1d331d5ea" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual cal3d::RefCounted::~RefCounted </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Protected so users of refcounted classes don't use std::auto_ptr or the delete operator. <p> Interfaces that derive from <a class="el" href="classcal3d_1_1RefCounted.html" title="Derive from RefCounted to make your class have reference-counted lifetime semantics...">RefCounted</a> should define an inline, empty, protected destructor as well. </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="refcounted_8h_source.html">refcounted.h</a></ul> </div> <hr> <center> <small> Generated at Fri Jul 24 21:14:57 2009 by <a href="http://gna.org/projects/cal3d/">The Cal3D Team</a> with <a href="http://www.doxygen.org/index.html"> Doxygen 1.5.9 </a> </small> </center> </body> </html>