File: classwx_ref_counter.html

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (208 lines) | stat: -rw-r--r-- 17,449 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxRefCounter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
 <tbody>
 <tr>
  <td id="projectlogo">
    <a href="http://www.wxwidgets.org/" target="_new">
      <img alt="wxWidgets" src="logo.png"/>
    </a>
  </td>
  <td style="padding-left: 0.5em; text-align: right;">
   <span id="projectnumber">Version: 3.0.2</span>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Categories</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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classwx_ref_counter-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">wxRefCounter Class Reference<div class="ingroups"><a class="el" href="group__group__class__rtti.html">Runtime Type Information (RTTI)</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;wx/object.h&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxRefCounter:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_ref_counter__inherit__graph.png" border="0" usemap="#wx_ref_counter_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_ref_counter_inherit__map" id="wx_ref_counter_inherit__map">
<area shape="rect" id="node3" href="classwx_data_view_model.html" title="wxDataViewModel is the base class for all data model to be displayed by a wxDataViewCtrl." alt="" coords="163,89,288,117"/><area shape="rect" id="node15" href="classwx_grid_cell_attr.html" title="This class can be used to alter the cells&#39; appearance in the grid by changing their attributes from t..." alt="" coords="173,139,277,167"/><area shape="rect" id="node17" href="classwx_grid_cell_editor.html" title="This class is responsible for providing and manipulating the in&#45;place edit controls for the grid..." alt="" coords="168,190,283,218"/><area shape="rect" id="node33" href="classwx_grid_cell_renderer.html" title="This class is responsible for actually drawing the cell in the grid." alt="" coords="159,350,292,378"/><area shape="rect" id="node5" href="classwx_data_view_list_model.html" title="Base class with abstract API for wxDataViewIndexListModel and wxDataViewVirtualListModel." alt="" coords="353,38,500,66"/><area shape="rect" id="node13" href="classwx_data_view_tree_store.html" title="wxDataViewTreeStore is a specialised wxDataViewModel for storing simple trees very much like wxTreeCt..." alt="" coords="353,89,500,117"/><area shape="rect" id="node7" href="classwx_data_view_index_list_model.html" title="wxDataViewIndexListModel is a specialized data model which lets you address an item by its position (..." alt="" coords="568,5,744,33"/><area shape="rect" id="node11" href="classwx_data_view_virtual_list_model.html" title="wxDataViewVirtualListModel is a specialized data model which lets you address an item by its position..." alt="" coords="565,55,747,83"/><area shape="rect" id="node9" href="classwx_data_view_list_store.html" title="wxDataViewListStore is a specialised wxDataViewModel for storing a simple table of data..." alt="" coords="801,5,943,33"/><area shape="rect" id="node19" href="classwx_grid_cell_bool_editor.html" title="Grid cell editor for boolean data." alt="" coords="356,139,497,167"/><area shape="rect" id="node21" href="classwx_grid_cell_choice_editor.html" title="Grid cell editor for string data providing the user a choice from a list of strings." alt="" coords="349,190,504,218"/><area shape="rect" id="node25" href="classwx_grid_cell_text_editor.html" title="Grid cell editor for string/text data." alt="" coords="356,241,497,269"/><area shape="rect" id="node23" href="classwx_grid_cell_enum_editor.html" title="Grid cell editor which displays an enum number as a textual equivalent (eg." alt="" coords="581,123,731,151"/><area shape="rect" id="node27" href="classwx_grid_cell_auto_wrap_string_editor.html" title="Grid cell editor for wrappable string/text data." alt="" coords="569,174,743,218"/><area shape="rect" id="node29" href="classwx_grid_cell_float_editor.html" title="The editor for floating point numbers data." alt="" coords="584,241,728,269"/><area shape="rect" id="node31" href="classwx_grid_cell_number_editor.html" title="Grid cell editor for numeric integer data." alt="" coords="576,291,736,319"/><area shape="rect" id="node35" href="classwx_grid_cell_bool_renderer.html" title="This class may be used to format boolean data in a cell." alt="" coords="347,350,507,378"/><area shape="rect" id="node37" href="classwx_grid_cell_string_renderer.html" title="This class may be used to format string data in a cell; it is the default for string cells..." alt="" coords="343,434,511,462"/><area shape="rect" id="node39" href="classwx_grid_cell_auto_wrap_string_renderer.html" title="This class may be used to format string data in a cell." alt="" coords="569,342,743,386"/><area shape="rect" id="node41" href="classwx_grid_cell_date_time_renderer.html" title="This class may be used to format a date/time data in a cell." alt="" coords="561,409,751,437"/><area shape="rect" id="node43" href="classwx_grid_cell_enum_renderer.html" title="This class may be used to render in a cell a number as a textual equivalent." alt="" coords="572,459,740,487"/><area shape="rect" id="node45" href="classwx_grid_cell_float_renderer.html" title="This class may be used to format floating point data in a cell." alt="" coords="575,510,737,538"/><area shape="rect" id="node47" href="classwx_grid_cell_number_renderer.html" title="This class may be used to format integer data in a cell." alt="" coords="567,561,745,589"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is used to manage reference-counting providing a simple interface and a counter. </p>
<p><a class="el" href="classwx_ref_counter.html" title="This class is used to manage reference-counting providing a simple interface and a counter...">wxRefCounter</a> can be easily used together with <a class="el" href="classwx_object_data_ptr_3_01_t_01_4.html" title="This is an helper template class primarily written to avoid memory leaks because of missing calls to ...">wxObjectDataPtr&lt;T&gt;</a> to ensure that no calls to <a class="el" href="classwx_ref_counter.html#a803eb5be907b1a342082ceb59c01d8c5" title="Decrements the reference count associated with this shared data and, if it reaches zero...">wxRefCounter::DecRef()</a> are missed - thus avoiding memory leaks.</p>
<p><a class="el" href="classwx_object_ref_data.html" title="This class is just a typedef to wxRefCounter and is used by wxObject.">wxObjectRefData</a> is a typedef to <a class="el" href="classwx_ref_counter.html" title="This class is used to manage reference-counting providing a simple interface and a counter...">wxRefCounter</a> and is used as the built-in reference counted storage for wxObject-derived classes.</p>
<h2></h2>
<div><span class="lib">Library:</span>&#160;&#160;<span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>&#160;&#160;<span class="category_text"><a class="el" href="group__group__class__rtti.html">Runtime Type Information (RTTI)</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_object.html" title="This is the root class of many of the wxWidgets classes.">wxObject</a>, <a class="el" href="classwx_object_ref_data.html" title="This class is just a typedef to wxRefCounter and is used by wxObject.">wxObjectRefData</a>, <a class="el" href="classwx_object_data_ptr_3_01_t_01_4.html" title="This is an helper template class primarily written to avoid memory leaks because of missing calls to ...">wxObjectDataPtr&lt;T&gt;</a>, <a class="el" href="overview_refcount.html">Reference Counting</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aebcddb8241dfea7f60f8e4df6776a0e3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_ref_counter.html#aebcddb8241dfea7f60f8e4df6776a0e3">wxRefCounter</a> ()</td></tr>
<tr class="memdesc:aebcddb8241dfea7f60f8e4df6776a0e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#aebcddb8241dfea7f60f8e4df6776a0e3"></a><br/></td></tr>
<tr class="separator:aebcddb8241dfea7f60f8e4df6776a0e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a803eb5be907b1a342082ceb59c01d8c5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_ref_counter.html#a803eb5be907b1a342082ceb59c01d8c5">DecRef</a> ()</td></tr>
<tr class="memdesc:a803eb5be907b1a342082ceb59c01d8c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of <a class="el" href="classwx_ref_counter.html" title="This class is used to manage reference-counting providing a simple interface and a counter...">wxRefCounter</a> releasing its memory.  <a href="#a803eb5be907b1a342082ceb59c01d8c5"></a><br/></td></tr>
<tr class="separator:a803eb5be907b1a342082ceb59c01d8c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89049a62c4e8f7823e2ef6216685f109"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_ref_counter.html#a89049a62c4e8f7823e2ef6216685f109">GetRefCount</a> () const </td></tr>
<tr class="memdesc:a89049a62c4e8f7823e2ef6216685f109"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the reference count associated with this shared data.  <a href="#a89049a62c4e8f7823e2ef6216685f109"></a><br/></td></tr>
<tr class="separator:a89049a62c4e8f7823e2ef6216685f109"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fec1fb6f778d9df7a8c046ad6a2d887"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_ref_counter.html#a9fec1fb6f778d9df7a8c046ad6a2d887">IncRef</a> ()</td></tr>
<tr class="memdesc:a9fec1fb6f778d9df7a8c046ad6a2d887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the reference count associated with this shared data.  <a href="#a9fec1fb6f778d9df7a8c046ad6a2d887"></a><br/></td></tr>
<tr class="separator:a9fec1fb6f778d9df7a8c046ad6a2d887"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aeaa9aceda6421eaa0d693cc29795263a"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_ref_counter.html#aeaa9aceda6421eaa0d693cc29795263a">~wxRefCounter</a> ()</td></tr>
<tr class="memdesc:aeaa9aceda6421eaa0d693cc29795263a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#aeaa9aceda6421eaa0d693cc29795263a"></a><br/></td></tr>
<tr class="separator:aeaa9aceda6421eaa0d693cc29795263a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aeaa9aceda6421eaa0d693cc29795263a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual wxRefCounter::~wxRefCounter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor. </p>
<p>It's declared <code>protected</code> so that <a class="el" href="classwx_ref_counter.html" title="This class is used to manage reference-counting providing a simple interface and a counter...">wxRefCounter</a> instances will never be destroyed directly but only as result of a <a class="el" href="classwx_ref_counter.html#a803eb5be907b1a342082ceb59c01d8c5" title="Decrements the reference count associated with this shared data and, if it reaches zero...">DecRef()</a> call. </p>

</div>
</div>
<a class="anchor" id="aebcddb8241dfea7f60f8e4df6776a0e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxRefCounter::wxRefCounter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default constructor. </p>
<p>Initialises the internal reference count to 1. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a803eb5be907b1a342082ceb59c01d8c5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxRefCounter::DecRef </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of <a class="el" href="classwx_ref_counter.html" title="This class is used to manage reference-counting providing a simple interface and a counter...">wxRefCounter</a> releasing its memory. </p>
<p>Please note that after calling this function, the caller should absolutely avoid to use the pointer to this instance since it may not be valid anymore. </p>

</div>
</div>
<a class="anchor" id="a89049a62c4e8f7823e2ef6216685f109"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int wxRefCounter::GetRefCount </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the reference count associated with this shared data. </p>
<p>When this goes to zero during a <a class="el" href="classwx_ref_counter.html#a803eb5be907b1a342082ceb59c01d8c5" title="Decrements the reference count associated with this shared data and, if it reaches zero...">DecRef()</a> call, the object will auto-free itself. </p>

</div>
</div>
<a class="anchor" id="a9fec1fb6f778d9df7a8c046ad6a2d887"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxRefCounter::IncRef </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Increments the reference count associated with this shared data. </p>

</div>
</div>
</div><!-- contents -->

<address class="footer">
	<small>
		Generated on Thu Nov 27 2014 13:46:54 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
	</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>