<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qshareddata.cpp --> <title>Qt 4.8: QExplicitlySharedDataPointer Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtcore.html">QtCore</a></li> <li>QExplicitlySharedDataPointer</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QExplicitlySharedDataPointer Class Reference</h1> <!-- $$$QExplicitlySharedDataPointer-brief --> <p>The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object. <a href="#details">More...</a></p> <!-- @@@QExplicitlySharedDataPointer --> <pre class="cpp"> <span class="preprocessor">#include <QExplicitlySharedDataPointer></span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <p>This class was introduced in Qt 4.4.</p> <ul> <li><a href="qexplicitlyshareddatapointer-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#Type-typedef">Type</a></b></td></tr> </table> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#QExplicitlySharedDataPointer">QExplicitlySharedDataPointer</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#QExplicitlySharedDataPointer-2">QExplicitlySharedDataPointer</a></b> ( T * <i>sharedData</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#QExplicitlySharedDataPointer-3">QExplicitlySharedDataPointer</a></b> ( const QExplicitlySharedDataPointer<T> & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#QExplicitlySharedDataPointer-4">QExplicitlySharedDataPointer</a></b> ( const QExplicitlySharedDataPointer<X> & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#dtor.QExplicitlySharedDataPointer">~QExplicitlySharedDataPointer</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const T * </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#constData">constData</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> T * </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#data">data</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#detach">detach</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#reset">reset</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#swap">swap</a></b> ( QExplicitlySharedDataPointer & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-bool">operator bool</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-not">operator!</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-not-eq">operator!=</a></b> ( const QExplicitlySharedDataPointer<T> & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-not-eq-2">operator!=</a></b> ( const T * <i>ptr</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> T & </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-2a">operator*</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> T * </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator--gt">operator-></a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> T * </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator--gt-2">operator-></a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QExplicitlySharedDataPointer<T> & </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-eq">operator=</a></b> ( const QExplicitlySharedDataPointer<T> & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QExplicitlySharedDataPointer & </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-eq-2">operator=</a></b> ( T * <i>sharedData</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-eq-eq">operator==</a></b> ( const QExplicitlySharedDataPointer<T> & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#operator-eq-eq-2">operator==</a></b> ( const T * <i>ptr</i> ) const</td></tr> </table> <a name="protected-functions"></a> <h2>Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> T * </td><td class="memItemRight bottomAlign"><b><a href="qexplicitlyshareddatapointer.html#clone">clone</a></b> ()</td></tr> </table> <a name="details"></a> <!-- $$$QExplicitlySharedDataPointer-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object.</p> <p>QExplicitlySharedDataPointer<T> makes writing your own explicitly shared classes easy. QExplicitlySharedDataPointer implements <a href="threads-reentrancy.html#thread-safe">thread-safe</a> reference counting, ensuring that adding QExplicitlySharedDataPointers to your <a href="threads-reentrancy.html#reentrant">reentrant</a> classes won't make them non-reentrant.</p> <p>Except for one big difference, QExplicitlySharedDataPointer is just like <a href="qshareddatapointer.html">QSharedDataPointer</a>. The big difference is that member functions of QExplicitlySharedDataPointer <i>do not</i> do the automatic <i>copy on write</i> operation (<a href="qexplicitlyshareddatapointer.html#detach">detach</a>()) that non-const members of <a href="qshareddatapointer.html">QSharedDataPointer</a> do before allowing the shared data object to be modified. There is a <a href="qexplicitlyshareddatapointer.html#detach">detach</a>() function available, but if you really want to <a href="qexplicitlyshareddatapointer.html#detach">detach</a>(), you have to call it yourself. This means that QExplicitlySharedDataPointers behave like regular C++ pointers, except that by doing reference counting and not deleting the shared data object until the reference count is 0, they avoid the dangling pointer problem.</p> <p>It is instructive to compare QExplicitlySharedDataPointer with <a href="qshareddatapointer.html">QSharedDataPointer</a> by way of an example. Consider the <a href="qshareddatapointer.html#employee-example">Employee example</a> in <a href="qshareddatapointer.html">QSharedDataPointer</a>, modified to use explicit sharing as explained in the discussion <a href="qshareddatapointer.html#implicit-vs-explicit-sharing">Implicit vs Explicit Sharing</a>.</p> <p>Note that if you use this class but find you are calling <a href="qexplicitlyshareddatapointer.html#detach">detach</a>() a lot, you probably should be using <a href="qshareddatapointer.html">QSharedDataPointer</a> instead.</p> <p>In the member function documentation, <i>d pointer</i> always refers to the internal pointer to the shared data object.</p> </div> <p><b>See also </b><a href="qshareddata.html">QSharedData</a> and <a href="qshareddatapointer.html">QSharedDataPointer</a>.</p> <!-- @@@QExplicitlySharedDataPointer --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$Type --> <h3 class="fn"><a name="Type-typedef"></a>typedef QExplicitlySharedDataPointer::<span class="name">Type</span></h3> <p>This is the type of the shared data object. The <i>d pointer</i> points to an object of this type.</p> <!-- @@@Type --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QExplicitlySharedDataPointer[overload1]$$$QExplicitlySharedDataPointer --> <h3 class="fn"><a name="QExplicitlySharedDataPointer"></a>QExplicitlySharedDataPointer::<span class="name">QExplicitlySharedDataPointer</span> ()</h3> <p>Constructs a <a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a> initialized with a null <i>d pointer</i>.</p> <!-- @@@QExplicitlySharedDataPointer --> <!-- $$$QExplicitlySharedDataPointer$$$QExplicitlySharedDataPointerT* --> <h3 class="fn"><a name="QExplicitlySharedDataPointer-2"></a>QExplicitlySharedDataPointer::<span class="name">QExplicitlySharedDataPointer</span> ( <span class="type">T</span> * <i>sharedData</i> )</h3> <p>Constructs a <a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a> with <i>d pointer</i> set to <i>sharedData</i> and increments <i>sharedData</i>'s reference count.</p> <!-- @@@QExplicitlySharedDataPointer --> <!-- $$$QExplicitlySharedDataPointer$$$QExplicitlySharedDataPointerconstQExplicitlySharedDataPointer<T>& --> <h3 class="fn"><a name="QExplicitlySharedDataPointer-3"></a>QExplicitlySharedDataPointer::<span class="name">QExplicitlySharedDataPointer</span> ( const <span class="type">QExplicitlySharedDataPointer</span><<span class="type">T</span>> & <i>other</i> )</h3> <p>This standard copy constructor 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> <!-- @@@QExplicitlySharedDataPointer --> <!-- $$$QExplicitlySharedDataPointer$$$QExplicitlySharedDataPointerconstQExplicitlySharedDataPointer<X>& --> <h3 class="fn"><a name="QExplicitlySharedDataPointer-4"></a>QExplicitlySharedDataPointer::<span class="name">QExplicitlySharedDataPointer</span> ( const <span class="type">QExplicitlySharedDataPointer</span><<span class="type">X</span>> & <i>other</i> )</h3> <p>This copy constructor is different in that it allows <i>other</i> to be a different type of explicitly shared data pointer but one that has a compatible shared data object. It performs a static cast of the <i>d pointer</i> in <i>other</i> and sets the <i>d pointer</i> of <i>this</i> to the converted <i>d pointer</i>. It increments the reference count of the shared data object.</p> <!-- @@@QExplicitlySharedDataPointer --> <!-- $$$~QExplicitlySharedDataPointer[overload1]$$$~QExplicitlySharedDataPointer --> <h3 class="fn"><a name="dtor.QExplicitlySharedDataPointer"></a>QExplicitlySharedDataPointer::<span class="name">~QExplicitlySharedDataPointer</span> ()</h3> <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> <!-- @@@~QExplicitlySharedDataPointer --> <!-- $$$clone[overload1]$$$clone --> <h3 class="fn"><a name="clone"></a><span class="type">T</span> * QExplicitlySharedDataPointer::<span class="name">clone</span> ()<tt> [protected]</tt></h3> <p>Creates and returns a deep copy of the current data. This function is called by <a href="qexplicitlyshareddatapointer.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> <p>See <a href="qshareddatapointer.html#clone">QSharedDataPointer::clone</a>() for an explanation of how to use it.</p> <p>This function was introduced in Qt 4.5.</p> <!-- @@@clone --> <!-- $$$constData[overload1]$$$constData --> <h3 class="fn"><a name="constData"></a>const <span class="type">T</span> * QExplicitlySharedDataPointer::<span class="name">constData</span> () const</h3> <p>Returns a const pointer to the shared data object.</p> <p><b>See also </b><a href="qexplicitlyshareddatapointer.html#data">data</a>().</p> <!-- @@@constData --> <!-- $$$data[overload1]$$$data --> <h3 class="fn"><a name="data"></a><span class="type">T</span> * QExplicitlySharedDataPointer::<span class="name">data</span> () const</h3> <p>Returns a pointer to the shared data object.</p> <!-- @@@data --> <!-- $$$detach[overload1]$$$detach --> <h3 class="fn"><a name="detach"></a><span class="type">void</span> QExplicitlySharedDataPointer::<span class="name">detach</span> ()</h3> <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> <p>Because <a href="qexplicitlyshareddatapointer.html">QExplicitlySharedDataPointer</a> does not do the automatic <i>copy on write</i> operations that members of <a href="qshareddatapointer.html">QSharedDataPointer</a> do, detach() is <i>not</i> called automatically anywhere in the member functions of this class. If you find that you are calling detach() everywhere in your code, consider using <a href="qshareddatapointer.html">QSharedDataPointer</a> instead.</p> <!-- @@@detach --> <!-- $$$reset[overload1]$$$reset --> <h3 class="fn"><a name="reset"></a><span class="type">void</span> QExplicitlySharedDataPointer::<span class="name">reset</span> ()</h3> <p>Resets <i>this</i> to be null. i.e., this function sets the <i>d pointer</i> of <i>this</i> to 0, but first it decrements the reference count of the shared data object and deletes the shared data object if the reference count became 0.</p> <!-- @@@reset --> <!-- $$$swap[overload1]$$$swapQExplicitlySharedDataPointer& --> <h3 class="fn"><a name="swap"></a><span class="type">void</span> QExplicitlySharedDataPointer::<span class="name">swap</span> ( <span class="type">QExplicitlySharedDataPointer</span> & <i>other</i> )</h3> <p>Swap this instance's explicitly shared data pointer with the explicitly shared data pointer in <i>other</i>.</p> <!-- @@@swap --> <!-- $$$operator bool[overload1]$$$operator bool --> <h3 class="fn"><a name="operator-bool"></a>QExplicitlySharedDataPointer::<span class="name">operator bool</span> () const</h3> <p>Returns true if the <i>d pointer</i> of <i>this</i> is <i>not</i> null.</p> <!-- @@@operator bool --> <!-- $$$operator![overload1]$$$operator! --> <h3 class="fn"><a name="operator-not"></a><span class="type">bool</span> QExplicitlySharedDataPointer::<span class="name">operator!</span> () const</h3> <p>Returns true if the <i>d pointer</i> of <i>this</i> is null.</p> <!-- @@@operator! --> <!-- $$$operator!=[overload1]$$$operator!=constQExplicitlySharedDataPointer<T>& --> <h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QExplicitlySharedDataPointer::<span class="name">operator!=</span> ( const <span class="type">QExplicitlySharedDataPointer</span><<span class="type">T</span>> & <i>other</i> ) const</h3> <p>Returns true if <i>other</i> and <i>this</i> do <i>not</i> have the same <i>d pointer</i>.</p> <!-- @@@operator!= --> <!-- $$$operator!=$$$operator!=constT* --> <h3 class="fn"><a name="operator-not-eq-2"></a><span class="type">bool</span> QExplicitlySharedDataPointer::<span class="name">operator!=</span> ( const <span class="type">T</span> * <i>ptr</i> ) const</h3> <p>Returns true if the <i>d pointer</i> of <i>this</i> is <i>not</i> <i>ptr</i>.</p> <!-- @@@operator!= --> <!-- $$$operator*[overload1]$$$operator* --> <h3 class="fn"><a name="operator-2a"></a><span class="type">T</span> & QExplicitlySharedDataPointer::<span class="name">operator*</span> () const</h3> <p>Provides access to the shared data object's members.</p> <!-- @@@operator* --> <!-- $$$operator->[overload1]$$$operator-> --> <h3 class="fn"><a name="operator--gt"></a><span class="type">T</span> * QExplicitlySharedDataPointer::<span class="name">operator-></span> ()</h3> <p>Provides access to the shared data object's members.</p> <!-- @@@operator-> --> <!-- $$$operator->$$$operator-> --> <h3 class="fn"><a name="operator--gt-2"></a><span class="type">T</span> * QExplicitlySharedDataPointer::<span class="name">operator-></span> () const</h3> <p>Provides const access to the shared data object's members.</p> <!-- @@@operator-> --> <!-- $$$operator=[overload1]$$$operator=constQExplicitlySharedDataPointer<T>& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QExplicitlySharedDataPointer</span><<span class="type">T</span>> & QExplicitlySharedDataPointer::<span class="name">operator=</span> ( const <span class="type">QExplicitlySharedDataPointer</span><<span class="type">T</span>> & <i>other</i> )</h3> <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> <!-- @@@operator= --> <!-- $$$operator=$$$operator=T* --> <h3 class="fn"><a name="operator-eq-2"></a><span class="type">QExplicitlySharedDataPointer</span> & QExplicitlySharedDataPointer::<span class="name">operator=</span> ( <span class="type">T</span> * <i>sharedData</i> )</h3> <p>Sets the <i>d pointer</i> of <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> <!-- @@@operator= --> <!-- $$$operator==[overload1]$$$operator==constQExplicitlySharedDataPointer<T>& --> <h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QExplicitlySharedDataPointer::<span class="name">operator==</span> ( const <span class="type">QExplicitlySharedDataPointer</span><<span class="type">T</span>> & <i>other</i> ) const</h3> <p>Returns true if <i>other</i> and <i>this</i> have the same <i>d pointer</i>.</p> <!-- @@@operator== --> <!-- $$$operator==$$$operator==constT* --> <h3 class="fn"><a name="operator-eq-eq-2"></a><span class="type">bool</span> QExplicitlySharedDataPointer::<span class="name">operator==</span> ( const <span class="type">T</span> * <i>ptr</i> ) const</h3> <p>Returns true if the <i>d pointer</i> of <i>this</i> is <i>ptr</i>.</p> <!-- @@@operator== --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>