Symbian3/SDK/Source/GUID-E16E286C-FB6A-5D3E-95D6-044C39DBA2B4.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE concept
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
89d6a7a84779 Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
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_d0e219835_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>