]> git.saurik.com Git - wxWidgets.git/commitdiff
Update docs to mention wxRefCounter class
authorRobert Roebling <robert@roebling.de>
Fri, 12 Jun 2009 20:29:59 +0000 (20:29 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 12 Jun 2009 20:29:59 +0000 (20:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/doxygen/overviews/refcount.h
interface/wx/object.h

index 75454a80c3149b673b9b92d969389aadc5b0c3dc..d8525b710d6fd49ff0cb3dbbfc3eb8513c33d440 100644 (file)
@@ -99,11 +99,12 @@ will result in an assert failure in debug builds.
 
 @section overview_refcount_object Making Your Own Reference Counted Class
 
 
 @section overview_refcount_object Making Your Own Reference Counted Class
 
-Reference counting can be implemented easily using wxObject and wxObjectRefData
-classes. Alternatively, you can also use the wxObjectDataPtr<T> template.
+Reference counting can be implemented easily using wxObject or using
+the intermediate wxRefCounter class directly. 
+Alternatively, you can also use the wxObjectDataPtr<T> template.
 
 
-First, derive a new class from wxObjectRefData and put there the
-memory-consuming data.
+First, derive a new class from wxRefCounter (or wxObjectRefData when
+using a wxObject derived class) and put the memory-consuming data in it.
 
 Then derive a new class from wxObject and implement there the public interface
 which will be seen by the user of your class. You'll probably want to add a
 
 Then derive a new class from wxObject and implement there the public interface
 which will be seen by the user of your class. You'll probably want to add a
index 72efca8132d7a11c0cac4013fe946faeb9bb980d..43beb09c317b1000ee2b161a26c7e05aa31942d1 100644 (file)
@@ -1,15 +1,14 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        object.h
 /////////////////////////////////////////////////////////////////////////////
 // Name:        object.h
-// Purpose:     interface of wxObjectRefData
+// Purpose:     interface of wxRefCounter
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-/**
-    @class wxObjectRefData
+/** @class wxObjectRefData
 
 
-    This class is used to store reference-counted data.
+    This class is just a typedef to wxRefCounter and is used by wxObject.
 
     Derive classes from this to store your own data. When retrieving information
     from a wxObject's reference data, you will need to cast to your own derived class.
 
     Derive classes from this to store your own data. When retrieving information
     from a wxObject's reference data, you will need to cast to your own derived class.
     }
     @endcode
 
     }
     @endcode
 
-
+    
     @library{wxbase}
     @category{rtti}
 
     @see wxObject, wxObjectDataPtr<T>, @ref overview_refcount
 */
     @library{wxbase}
     @category{rtti}
 
     @see wxObject, wxObjectDataPtr<T>, @ref overview_refcount
 */
-class wxObjectRefData
+typedef wxRefCounter wxObjectRefData;
+
+
+/**
+    @class wxRefCounter
+
+    This class is used to manage reference-counting.
+
+    @library{wxbase}
+    @category{rtti}
+
+    @see wxObject, wxObjectRefData, wxObjectDataPtr<T>, @ref overview_refcount
+*/
+class wxRefCounter
 {
 protected:
     /**
         Destructor.
 
 {
 protected:
     /**
         Destructor.
 
-        It's declared @c protected so that wxObjectRefData instances
+        It's declared @c protected so that wxRefCounter instances
         will never be destroyed directly but only as result of a DecRef() call.
     */
         will never be destroyed directly but only as result of a DecRef() call.
     */
-    virtual ~wxObjectRefData();
+    virtual ~wxRefCounter();
 
 public:
     /**
         Default constructor. Initialises the internal reference count to 1.
     */
 
 public:
     /**
         Default constructor. Initialises the internal reference count to 1.
     */
-    wxObjectRefData();
+    wxRefCounter();
 
     /**
         Decrements the reference count associated with this shared data and, if
 
     /**
         Decrements the reference count associated with this shared data and, if
-        it reaches zero, destroys this instance of wxObjectRefData releasing its
+        it reaches zero, destroys this instance of wxRefCounter releasing its
         memory.
 
         Please note that after calling this function, the caller should
         memory.
 
         Please note that after calling this function, the caller should
@@ -198,14 +210,14 @@ public:
     wxObject can be used to implement @ref overview_refcount "reference counted"
     objects, such as wxPen, wxBitmap and others
     (see @ref overview_refcount_list "this list").
     wxObject can be used to implement @ref overview_refcount "reference counted"
     objects, such as wxPen, wxBitmap and others
     (see @ref overview_refcount_list "this list").
-    See wxObjectRefData and @ref overview_refcount for more info about
+    See wxRefCounter and @ref overview_refcount for more info about
     reference counting.
 
     @library{wxbase}
     @category{rtti}
 
     @see wxClassInfo, @ref overview_debugging, @ref overview_refcount, 
     reference counting.
 
     @library{wxbase}
     @category{rtti}
 
     @see wxClassInfo, @ref overview_debugging, @ref overview_refcount, 
-         wxObjectRefData, wxObjectDataPtr<T>
+         wxObjectDataRef, wxObjectDataPtr<T>
 */
 class wxObject
 {
 */
 class wxObject
 {