Symbian3/SDK/Source/GUID-BE0C94BE-94F0-54B3-8674-366C09261E5D.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-BE0C94BE-94F0-54B3-8674-366C09261E5D"><title>Reference Counting Objects Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Purpose</title> <p>Provides reference counting objects and specialist containers for using them. </p> </section> <section><title>Architectural relationships</title> <p>Reference counting objects are largely used by server-side code to record the use of, and support access to, server-provided resources by multiple clients. The various container classes in the API provide the support for tracking the use of groups of such objects. </p> </section> <section><title>Description</title> <p><b>Reference counting object</b> </p> <p>A reference counting object tracks the number of references to itself, and destroys itself when the final reference is removed. As well as a reference count, the interface provides special provision for such objects to have a name, and to have ownership relationships between each other. </p> <p>The base class for reference counting objects is provided by <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref>. A program sub-classes this to provide support for a type of a reference-counted resource. </p> <p><b>Object container</b> </p> <p>A program needs to manage the instances of each type of reference counting object that it provides. For this reason, all reference counting objects must be held in array-like objects called object containers. Each object container is assigned a unique ID on construction. Objects in the container can be found by index position, name, or find-handle (a combination of container ID and object index position). </p> <p>The object container class is <xref href="GUID-DE901A59-C714-356A-9490-C4E9C9F186DB.dita"><apiname>CObjectCon</apiname></xref>. </p> <p><b>Object container index</b> </p> <p>Object containers are themselves constructed through a class called an object container index, <xref href="GUID-72761B3C-ECB6-34B2-87ED-C972E479357A.dita"><apiname>CObjectConIx</apiname></xref>. The object container index also has array-like features: it assigns an ID to each container created, and allows containers to be accessed through their IDs. </p> <p><b>Object index</b> </p> <p>It can be useful to treat reference counting objects as members of groups other than their object containers. An object index is an array of references to reference-counted objects. Multiple instances of the same object, and objects from multiple object containers are allowed. As a way to identify their members, indexes can provide handle-numbers that combine the instance number of the reference counting object with the index of its position within the object index's array. </p> <p>The object index class is <xref href="GUID-70824EE4-9E01-3AC0-9318-4B521A1FDD5E.dita"><apiname>CObjectIx</apiname></xref>. </p> </section> </conbody></concept>