~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qshareddatapointer.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/src/corelib/tools/qshareddata.cpp -->
 
5
<!-- qshareddata.cpp -->
6
6
<head>
7
 
  <title>Qt 4.5: QSharedDataPointer Class Reference</title>
 
7
  <title>Qt 4.6: QSharedDataPointer Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QSharedDataPointer" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QSharedDataPointer Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">QSharedDataPointer Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
16
17
</h1>
17
18
<p>The QSharedDataPointer class represents a pointer to an implicitly shared object. <a href="#details">More...</a></p>
18
 
<pre> #include &lt;QSharedDataPointer&gt;</pre><p><b>Note:</b> All the functions in this class are <a href="threads.html#reentrant">reentrant</a>.</p>
 
19
<pre> #include &lt;QSharedDataPointer&gt;</pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
19
20
<p>This class was introduced in Qt 4.0.</p>
20
21
<ul>
21
22
<li><a href="qshareddatapointer-members.html">List of all members, including inherited members</a></li>
22
23
</ul>
 
24
<hr />
 
25
<a name="public-types"></a>
 
26
<h2>Public Types</h2>
 
27
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
28
<tr><td class="memItemLeft" align="right" valign="top">typedef </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#Type-typedef">Type</a></b></td></tr>
 
29
</table>
 
30
<hr />
23
31
<a name="public-functions"></a>
24
 
<h3>Public Functions</h3>
25
 
<ul>
26
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#QSharedDataPointer">QSharedDataPointer</a></b> ()</li>
27
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#QSharedDataPointer-2">QSharedDataPointer</a></b> ( T * <i>sharedData</i> )</li>
28
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#QSharedDataPointer-3">QSharedDataPointer</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</li>
29
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#dtor.QSharedDataPointer">~QSharedDataPointer</a></b> ()</li>
30
 
<li><div class="fn"></div>const T * <b><a href="qshareddatapointer.html#constData">constData</a></b> () const</li>
31
 
<li><div class="fn"></div>T * <b><a href="qshareddatapointer.html#data">data</a></b> ()</li>
32
 
<li><div class="fn"></div>const T * <b><a href="qshareddatapointer.html#data-2">data</a></b> () const</li>
33
 
<li><div class="fn"></div>void <b><a href="qshareddatapointer.html#detach">detach</a></b> ()</li>
34
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#operator-T--2a">operator T *</a></b> ()</li>
35
 
<li><div class="fn"></div><b><a href="qshareddatapointer.html#operator-const-T--2a">operator const T *</a></b> () const</li>
36
 
<li><div class="fn"></div>bool <b><a href="qshareddatapointer.html#operator-not">operator!</a></b> () const</li>
37
 
<li><div class="fn"></div>bool <b><a href="qshareddatapointer.html#operator-not-eq">operator!=</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</li>
38
 
<li><div class="fn"></div>T &amp; <b><a href="qshareddatapointer.html#operator-2a">operator*</a></b> ()</li>
39
 
<li><div class="fn"></div>const T &amp; <b><a href="qshareddatapointer.html#operator-2a-2">operator*</a></b> () const</li>
40
 
<li><div class="fn"></div>T * <b><a href="qshareddatapointer.html#operator--gt">operator-&gt;</a></b> ()</li>
41
 
<li><div class="fn"></div>const T * <b><a href="qshareddatapointer.html#operator--gt-2">operator-&gt;</a></b> () const</li>
42
 
<li><div class="fn"></div>QSharedDataPointer&lt;T&gt; &amp; <b><a href="qshareddatapointer.html#operator-eq">operator=</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</li>
43
 
<li><div class="fn"></div>QSharedDataPointer &amp; <b><a href="qshareddatapointer.html#operator-eq-2">operator=</a></b> ( T * <i>sharedData</i> )</li>
44
 
<li><div class="fn"></div>bool <b><a href="qshareddatapointer.html#operator-eq-eq">operator==</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</li>
45
 
</ul>
 
32
<h2>Public Functions</h2>
 
33
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
34
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#QSharedDataPointer">QSharedDataPointer</a></b> ()</td></tr>
 
35
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#QSharedDataPointer-2">QSharedDataPointer</a></b> ( T * <i>sharedData</i> )</td></tr>
 
36
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#QSharedDataPointer-3">QSharedDataPointer</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</td></tr>
 
37
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#dtor.QSharedDataPointer">~QSharedDataPointer</a></b> ()</td></tr>
 
38
<tr><td class="memItemLeft" align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#constData">constData</a></b> () const</td></tr>
 
39
<tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#data">data</a></b> ()</td></tr>
 
40
<tr><td class="memItemLeft" align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#data-2">data</a></b> () const</td></tr>
 
41
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#detach">detach</a></b> ()</td></tr>
 
42
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#swap">swap</a></b> ( QSharedDataPointer &amp; <i>other</i> )</td></tr>
 
43
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-T--2a">operator T *</a></b> ()</td></tr>
 
44
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-const-T--2a">operator const T *</a></b> () const</td></tr>
 
45
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-not">operator!</a></b> () const</td></tr>
 
46
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-not-eq">operator!=</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</td></tr>
 
47
<tr><td class="memItemLeft" align="right" valign="top">T &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-2a">operator*</a></b> ()</td></tr>
 
48
<tr><td class="memItemLeft" align="right" valign="top">const T &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-2a-2">operator*</a></b> () const</td></tr>
 
49
<tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator--gt">operator-&gt;</a></b> ()</td></tr>
 
50
<tr><td class="memItemLeft" align="right" valign="top">const T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator--gt-2">operator-&gt;</a></b> () const</td></tr>
 
51
<tr><td class="memItemLeft" align="right" valign="top">QSharedDataPointer&lt;T&gt; &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-eq">operator=</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</td></tr>
 
52
<tr><td class="memItemLeft" align="right" valign="top">QSharedDataPointer &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-eq-2">operator=</a></b> ( T * <i>sharedData</i> )</td></tr>
 
53
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#operator-eq-eq">operator==</a></b> ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</td></tr>
 
54
</table>
 
55
<hr />
46
56
<a name="protected-functions"></a>
47
 
<h3>Protected Functions</h3>
48
 
<ul>
49
 
<li><div class="fn"></div>T * <b><a href="qshareddatapointer.html#clone">clone</a></b> ()</li>
50
 
</ul>
 
57
<h2>Protected Functions</h2>
 
58
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
59
<tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><b><a href="qshareddatapointer.html#clone">clone</a></b> ()</td></tr>
 
60
</table>
51
61
<a name="details"></a>
52
62
<hr />
53
63
<h2>Detailed Description</h2>
54
64
<p>The QSharedDataPointer class represents a pointer to an implicitly shared object.</p>
55
 
<p>QSharedDataPointer&lt;T&gt; makes writing your own <a href="shared.html#implicitly-shared">implicitly shared</a> classes easy. QSharedDataPointer implements <a href="threads.html#thread-safe">thread-safe</a> reference counting, ensuring that adding QSharedDataPointers to your <a href="threads.html#reentrant">reentrant</a> classes won't make them non-reentrant.</p>
56
 
<p><a href="shared.html#implicit-sharing">Implicit sharing</a> is used by many Qt classes to combine the speed and memory efficiency of pointers with the ease of use of classes. See the <a href="shared.html#shared-classes">Shared Classes</a> page for more information.</p>
 
65
<p>QSharedDataPointer&lt;T&gt; makes writing your own <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a> classes easy. QSharedDataPointer implements <a href="threads-reentrancy.html#thread-safe">thread-safe</a> reference counting, ensuring that adding QSharedDataPointers to your <a href="threads-reentrancy.html#reentrant">reentrant</a> classes won't make them non-reentrant.</p>
 
66
<p><a href="implicit-sharing.html">Implicit sharing</a> is used by many Qt classes to combine the speed and memory efficiency of pointers with the ease of use of classes. See the <a href="implicit-sharing.html#shared-classes">Shared Classes</a> page for more information.</p>
57
67
<a name="employee-example"></a><p>Suppose you want to make an <tt>Employee</tt> class implicitly shared. The procedure is:</p>
58
68
<ul>
59
69
<li>Define the class <tt>Employee</tt> to have a single data member of type <tt>QSharedDataPointer&lt;EmployeeData&gt;</tt>.</li>
141
151
<p>After the second employee e2 is created and e1 is assigned to it, both <tt>e1</tt> and <tt>e2</tt> refer to Albrecht Durer, employee 1001. Both <tt>Employee</tt> objects point to the same instance of <tt>EmployeeData</tt>, which has reference count 2. Then <tt>e1.setName(&quot;Hans Holbein&quot;)</tt> is called to change the employee name, but because the reference count is greater than 1, a <i>copy on write</i> is performed before the name is changed. Now <tt>e1</tt> and <tt>e2</tt> point to different <tt>EmployeeData</tt> objects. They have different names, but both have ID 1001, which is probably not what you want. You can, of course, just continue with <tt>e1.setId(1002)</tt>, if you really mean to create a second, unique employee, but if you only want to change the employee's name everywhere, consider using <a href="qexplicitlyshareddatapointer.html">explicit sharing</a> in the <tt>Employee</tt> class instead of implicit sharing.</p>
142
152
<p>If you declare the <i>d pointer</i> in the <tt>Employee</tt> class to be <tt>QExplicitlySharedDataPointer&lt;EmployeeData&gt;</tt>, then explicit sharing is used and <i>copy on write</i> operations are not performed automatically (i.e&#x2e; <a href="qshareddatapointer.html#detach">detach</a>() is not called in non-const functions). In that case, after <tt>e1.setName(&quot;Hans Holbein&quot;)</tt>, the employee's name has been changed, but both e1 and e2 still refer to the same instance of <tt>EmployeeData</tt>, so there is only one employee with ID 1001.</p>
143
153
<p>In the member function documentation, <i>d pointer</i> always refers to the internal pointer to the shared data object.</p>
144
 
<p>See also <a href="qshareddata.html">QSharedData</a> and <a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a>.</p>
 
154
<p>See also <a href="qshareddata.html">QSharedData</a>, <a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a>, <a href="qscopedpointer.html">QScopedPointer</a>, and <a href="qsharedpointer.html">QSharedPointer</a>.</p>
 
155
<hr />
 
156
<h2>Member Type Documentation</h2>
 
157
<a name="//apple_ref/cpp/tdef/QSharedDataPointer/Type" />
 
158
<h3 class="fn"><a name="Type-typedef"></a>typedef QSharedDataPointer::Type</h3>
 
159
<p>This is the type of the shared data object. The <i>d pointer</i> points to an object of this type.</p>
145
160
<hr />
146
161
<h2>Member Function Documentation</h2>
 
162
<a name="//apple_ref/cpp/instm/QSharedDataPointer/QSharedDataPointer" />
147
163
<h3 class="fn"><a name="QSharedDataPointer"></a>QSharedDataPointer::QSharedDataPointer ()</h3>
148
164
<p>Constructs a <a href="qshareddatapointer.html">QSharedDataPointer</a> initialized with a null <i>d pointer</i>.</p>
149
165
<h3 class="fn"><a name="QSharedDataPointer-2"></a>QSharedDataPointer::QSharedDataPointer ( T * <i>sharedData</i> )</h3>
150
166
<p>Constructs a <a href="qshareddatapointer.html">QSharedDataPointer</a> with <i>d pointer</i> set to <i>sharedData</i> and increments <i>sharedData</i>'s reference count.</p>
151
167
<h3 class="fn"><a name="QSharedDataPointer-3"></a>QSharedDataPointer::QSharedDataPointer ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</h3>
152
168
<p>Sets the <i>d pointer</i> of <i>this</i> to the <i>d pointer</i> in <i>other</i> and increments the reference count of the shared data object.</p>
 
169
<a name="//apple_ref/cpp/instm/QSharedDataPointer/~QSharedDataPointer" />
153
170
<h3 class="fn"><a name="dtor.QSharedDataPointer"></a>QSharedDataPointer::~QSharedDataPointer ()</h3>
154
171
<p>Decrements the reference count of the shared data object. If the reference count becomes 0, the shared data object is deleted. <i>This</i> is then destroyed.</p>
 
172
<a name="//apple_ref/cpp/instm/QSharedDataPointer/clone" />
155
173
<h3 class="fn"><a name="clone"></a>T * QSharedDataPointer::clone ()&nbsp;&nbsp;<tt> [protected]</tt></h3>
156
174
<p>Creates and returns a deep copy of the current data. This function is called by <a href="qshareddatapointer.html#detach">detach</a>() when the reference count is greater than 1 in order to create the new copy. This function uses the <i>operator new</i> and calls the copy constructor of the type T.</p>
157
175
<p>This function is provided so that you may support &quot;virtual copy constructors&quot; for your own types. In order to so, you should declare a template-specialization of this function for your own type, like the example below:</p>
162
180
 }</pre>
163
181
<p>In the example above, the template specialization for the clone() function calls the <i>EmployeeData::clone()</i> virtual function. A class derived from EmployeeData could override that function and return the proper polymorphic type.</p>
164
182
<p>This function was introduced in Qt 4.5.</p>
 
183
<a name="//apple_ref/cpp/instm/QSharedDataPointer/constData" />
165
184
<h3 class="fn"><a name="constData"></a>const T * QSharedDataPointer::constData () const</h3>
166
185
<p>Returns a const pointer to the shared data object. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
167
186
<p>See also <a href="qshareddatapointer.html#data">data</a>().</p>
 
187
<a name="//apple_ref/cpp/instm/QSharedDataPointer/data" />
168
188
<h3 class="fn"><a name="data"></a>T * QSharedDataPointer::data ()</h3>
169
189
<p>Returns a pointer to the shared data object. This function calls <a href="qshareddatapointer.html#detach">detach</a>().</p>
170
190
<p>See also <a href="qshareddatapointer.html#constData">constData</a>().</p>
171
191
<h3 class="fn"><a name="data-2"></a>const T * QSharedDataPointer::data () const</h3>
172
192
<p>Returns a pointer to the shared data object. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
 
193
<a name="//apple_ref/cpp/instm/QSharedDataPointer/detach" />
173
194
<h3 class="fn"><a name="detach"></a>void QSharedDataPointer::detach ()</h3>
174
195
<p>If the shared data object's reference count is greater than 1, this function creates a deep copy of the shared data object and sets the <i>d pointer</i> of <i>this</i> to the copy.</p>
175
196
<p>This function is called automatically by non-const member functions of <a href="qshareddatapointer.html">QSharedDataPointer</a> if <i>copy on write</i> is required. You don't need to call it yourself.</p>
 
197
<a name="//apple_ref/cpp/instm/QSharedDataPointer/swap" />
 
198
<h3 class="fn"><a name="swap"></a>void QSharedDataPointer::swap ( QSharedDataPointer &amp; <i>other</i> )</h3>
 
199
<p>Swap this instance's shared data pointer with the shared data pointer in <i>other</i>.</p>
 
200
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator T *" />
176
201
<h3 class="fn"><a name="operator-T--2a"></a>QSharedDataPointer::operator T * ()</h3>
177
202
<p>Returns a pointer to the shared data object. This function calls <a href="qshareddatapointer.html#detach">detach</a>().</p>
178
203
<p>See also <a href="qshareddatapointer.html#data">data</a>() and <a href="qshareddatapointer.html#constData">constData</a>().</p>
 
204
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator const T *" />
179
205
<h3 class="fn"><a name="operator-const-T--2a"></a>QSharedDataPointer::operator const T * () const</h3>
180
206
<p>Returns a pointer to the shared data object. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
 
207
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator!" />
181
208
<h3 class="fn"><a name="operator-not"></a>bool QSharedDataPointer::operator! () const</h3>
182
209
<p>Returns true if the <i>d pointer</i> of <i>this</i> is null.</p>
 
210
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator!=" />
183
211
<h3 class="fn"><a name="operator-not-eq"></a>bool QSharedDataPointer::operator!= ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</h3>
184
212
<p>Returns true if <i>other</i> and <i>this</i> do <i>not</i> have the same <i>d pointer</i>. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
 
213
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator*" />
185
214
<h3 class="fn"><a name="operator-2a"></a>T &amp; QSharedDataPointer::operator* ()</h3>
186
215
<p>Provides access to the shared data object's members. This function calls <a href="qshareddatapointer.html#detach">detach</a>().</p>
187
216
<h3 class="fn"><a name="operator-2a-2"></a>const T &amp; QSharedDataPointer::operator* () const</h3>
188
217
<p>Provides const access to the shared data object's members. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
 
218
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator->" />
189
219
<h3 class="fn"><a name="operator--gt"></a>T * QSharedDataPointer::operator-&gt; ()</h3>
190
220
<p>Provides access to the shared data object's members. This function calls <a href="qshareddatapointer.html#detach">detach</a>().</p>
191
221
<h3 class="fn"><a name="operator--gt-2"></a>const T * QSharedDataPointer::operator-&gt; () const</h3>
192
222
<p>Provides const access to the shared data object's members. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
 
223
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator=" />
193
224
<h3 class="fn"><a name="operator-eq"></a>QSharedDataPointer&lt;T&gt; &amp; QSharedDataPointer::operator= ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> )</h3>
194
225
<p>Sets the <i>d pointer</i> of <i>this</i> to the <i>d pointer</i> of <i>other</i> and increments the reference count of the shared data object. The reference count of the old shared data object of <i>this</i> is decremented. If the reference count of the old shared data object becomes 0, the old shared data object is deleted.</p>
195
226
<h3 class="fn"><a name="operator-eq-2"></a>QSharedDataPointer &amp; QSharedDataPointer::operator= ( T * <i>sharedData</i> )</h3>
196
227
<p>Sets the <i>d pointer</i> og <i>this</i> to <i>sharedData</i> and increments <i>sharedData</i>'s reference count. The reference count of the old shared data object of <i>this</i> is decremented. If the reference count of the old shared data object becomes 0, the old shared data object is deleted.</p>
 
228
<a name="//apple_ref/cpp/instm/QSharedDataPointer/operator==" />
197
229
<h3 class="fn"><a name="operator-eq-eq"></a>bool QSharedDataPointer::operator== ( const QSharedDataPointer&lt;T&gt; &amp; <i>other</i> ) const</h3>
198
230
<p>Returns true if <i>other</i> and <i>this</i> have the same <i>d pointer</i>. This function does <i>not</i> call <a href="qshareddatapointer.html#detach">detach</a>().</p>
199
231
<p /><address><hr /><div align="center">
200
232
<table width="100%" cellspacing="0" border="0"><tr class="address">
201
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
202
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
203
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
204
 
</tr></table></div></address></body>
 
233
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
234
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
235
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
236
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
205
237
</html>