Symbian3/SDK/Source/GUID-48C764A2-378F-57CC-B7F2-EC866AE8F830.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 8 ae94777fff8f
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     6
<!-- Initial Contributors:
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     7
    Nokia Corporation - initial contribution.
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     8
Contributors: 
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
     9
-->
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
    10
<!DOCTYPE concept
ae94777fff8f Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 7
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
13
48780e181b38 Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 8
diff changeset
    12
<concept xml:lang="en" id="GUID-48C764A2-378F-57CC-B7F2-EC866AE8F830"><title>The reference counting object</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>A reference counting object is one which uses reference counting to track concurrent references to itself and which arranges for automatic destruction of itself when the final reference is removed. It is also an object which can be named. </p> <p>A reference counting object is any object which has <codeph>CObject</codeph> as its base class. </p> <p>Constructing a <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref> derived type, or calling its <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita#GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97/GUID-E6319811-605D-3329-9314-ED25F4A9116C"><apiname>CObject::Open()</apiname></xref> member function, adds a reference to that object by adding one to its reference count. Calling its <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita#GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97/GUID-6E50F446-307B-3C9D-9AD6-AFCB49B2F658"><apiname>CObject::Close()</apiname></xref> member function removes a reference by subtracting one from its reference count. When the last user of the object calls <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita#GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97/GUID-6E50F446-307B-3C9D-9AD6-AFCB49B2F658"><apiname>CObject::Close()</apiname></xref>, the reference count becomes zero and the object is automatically destroyed. </p> <p>The following drawing shows the idea. </p> <fig id="GUID-18A04428-FBD7-5115-B206-6F2E67343A7F"><image href="GUID-39AAB0D3-6D4D-5DE3-B894-F5E763D3E19B_d0e249566_href.png" placement="inline"/></fig> <p>A <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref> is always part of a class hierarchy. It is a base class; an explicit <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref> type is never instantiated. </p> <p>The server side implementation of a client/server subsession uses a <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref>. </p> <p>See also: </p> <ul><li id="GUID-20A9F23B-19B5-5D70-9943-811FC42F3BED"><p> <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref>  </p> </li> <li id="GUID-8C980E14-F073-5918-AD66-8547656BC13D"><p> <xref href="GUID-1CC6FEF0-7D1E-5329-8276-22ACFE3DE362.dita">Subsessions within a session</xref>  </p> </li> <li id="GUID-C5FCE438-1F8B-569C-9257-0EBE9D823747"><p> <xref href="GUID-6047DB3F-DC92-51DF-9EEB-00E79E890B54.dita">Using client/server</xref>  </p> </li> </ul> </conbody></concept>