Symbian3/SDK/Source/GUID-E16E286C-FB6A-5D3E-95D6-044C39DBA2B4.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-E16E286C-FB6A-5D3E-95D6-044C39DBA2B4"><title>The object container</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>All reference counting objects must be held in an object container. An object container acts as a home for a set of related reference counting objects. </p> <p>An object container is an instance of a <xref href="GUID-DE901A59-C714-356A-9490-C4E9C9F186DB.dita"><apiname>CObjectCon</apiname></xref> class. </p> <p>After construction, a reference counting object <i>must</i> be added to an object container. Only one instance of a reference counting object can be held by an object container, i.e. each object within an object container must be distinct. </p> <p>The main characteristics of an object container can be summarised as follows: </p> <ul><li id="GUID-38B0A165-02EE-529F-9EEC-4BEAC6368489"><p>they allow a logical collections of reference counting objects to be gathered together. </p> </li> <li id="GUID-0C5A0F46-3B9C-5547-91C5-40177E2AC8A1"><p>explicitly destroying a reference counting object causes that object to be removed from its object container. </p> </li> <li id="GUID-5E89EA15-353B-5D97-AAEF-734F0999C686"><p>removing a reference counting object from its object container causes that object to be destroyed. </p> </li> <li id="GUID-A14CCB2B-4810-53DA-9CEC-402F9406BC37"><p>each object container is assigned a unique ID on construction. This is an integer that forms part of the identity of all of its contained reference counting objects. All reference counting objects within an object container are associated with the same unique ID. The value of the unique ID can range from 1 to 16,383 (0x3fff). </p> </li> </ul> <p>Object containers are constructed by an object container index, a <xref href="GUID-72761B3C-ECB6-34B2-87ED-C972E479357A.dita"><apiname>CObjectConIx</apiname></xref> type. The maximum number of object containers which may be constructed and held in an object container index is 6,383 (0x3fff). </p> <p>An object container is implemented as a simple array, where each element of the array is a pointer to a contained reference counting object. Adding a reference counting object to the object container is simply a matter of adding the reference counting object's pointer into the array. The following diagram shows a simple situation where two object containers hold a number of reference counting objects. </p> <fig id="GUID-6907E278-C900-5C2A-9540-29BBD1FF5BCB"><image href="GUID-40ED6F39-F8E2-5292-ADA5-C2507F256AE0_d0e249673_href.png" placement="inline"/></fig> <p>The <xref href="GUID-DE901A59-C714-356A-9490-C4E9C9F186DB.dita#GUID-DE901A59-C714-356A-9490-C4E9C9F186DB/GUID-4BEB5581-620D-3857-83AE-334B22C92554"><apiname>CObjectCon::AddL()</apiname></xref> function adds a reference counting object to the object container. </p> <p>The <xref href="GUID-DE901A59-C714-356A-9490-C4E9C9F186DB.dita#GUID-DE901A59-C714-356A-9490-C4E9C9F186DB/GUID-5BECBD93-AFB0-3D80-9307-3839F0DB920D"><apiname>CObjectCon::Remove()</apiname></xref> function removes a reference counting object from its object container and also destroys that reference counting object. Conversely, if the reference counting object is destroyed (typically, as a result of successive calls to <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>), it is removed from its object container. </p> <p>See also: </p> <ul><li id="GUID-35EBE5AE-3171-5299-8419-E372A365363E"><p> <xref href="GUID-DE901A59-C714-356A-9490-C4E9C9F186DB.dita"><apiname>CObjectCon</apiname></xref> </p> </li> <li id="GUID-000D298D-DA13-5345-A622-C21869898D97"><p> <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref>  </p> </li> </ul> </conbody></concept>