Symbian3/SDK/Source/GUID-FC639517-F138-5E84-B57A-6347F5A47B88.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-FC639517-F138-5E84-B57A-6347F5A47B88"><title>Names and fullnames</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>A reference counting object can be identified by a <i>name</i>. A name consists of a string of characters whose length must not be greater than <xref href="GUID-81C4F0D1-1D0A-3F43-8980-45B5343CAB9B.dita"><apiname>KMaxName</apiname></xref>, a symbol defined in e32std.h. </p> <p>A name can contain any character except: *, ? and :, i.e. the characters asterisk, question mark and single colon. The system static function <xref href="GUID-C197C9A7-EA05-3F24-9854-542E984C612D.dita#GUID-C197C9A7-EA05-3F24-9854-542E984C612D/GUID-F3DA1084-412D-3EB7-AA1A-5B743FC93A93"><apiname>User::ValidateName()</apiname></xref> is available to do this. </p> <p>A reference counting object can also be identified by its <i>full name</i>. This is descriptive of the reference counting object's ownership hierarchy, i.e. it is a name that identifies the reference counting object in the context of its owning reference counting object. </p> <p>The full name is a concatenation of: </p> <ul><li id="GUID-96BE031B-69EA-59F8-A983-65F1AA1E3FCF"><p>the <i>name</i> of the owning reference counting object, </p> </li> <li id="GUID-A5AD0140-0048-5325-873C-9A759F918C18"><p>a double colon <i>::</i> , </p> </li> <li id="GUID-EE78A739-423C-55BA-8257-48A1F226494E"><p>the name of the reference counting object. </p> </li> </ul> <p>For example, given the three <xref href="GUID-9230EF62-376A-389C-B720-7C1EDCB7EA97.dita"><apiname>CObject</apiname></xref> derived objects: <codeph>x</codeph>, <codeph>y</codeph> and <codeph>z</codeph> with names: <codeph>one</codeph>, <codeph>two</codeph> and <codeph>three</codeph> respectively, where <codeph>x</codeph> is owned by <codeph>y</codeph> and <codeph>y</codeph>, in turn, is owned by <codeph>z</codeph>: </p> <codeblock id="GUID-93857905-683A-5AA3-B36A-12BA87401A8E" xml:space="preserve">_LIT(KTxtOne,"one");
_LIT(KTxtTwo,"two");
_LIT(KTxtThree,"three");

class CSomeClass : public CObject
    {
    ...
    };

...
CSomeClass* x;
CSomeClass* y;
CSomeClass* z;
...
x = new(ELeave) CSomeClass;
y = new(ELeave) CSomeClass;
z = new(ELeave) CSomeClass;
...
x-&gt;SetName(KTxtOne);
y-&gt;SetName(KTxtTwo);
z-&gt;SetName(KTxtThree);
...
x-&gt;SetOwner(y);
y-&gt;SetOwner(z);
...
</codeblock> <ul><li id="GUID-AC8EAFEF-8F16-5074-B518-E3880F2851B3"><p>the full name of <codeph>x</codeph> is, <codeph>three::two::one</codeph>. </p> </li> <li id="GUID-09BAC1B3-E6B8-59F6-868E-F6D5DE11450C"><p>the full name of <codeph>y</codeph> is, <codeph>three::two</codeph>. </p> </li> <li id="GUID-D4AC3B84-53C8-5716-8CB7-6901100DE1D0"><p>the full name of <codeph>z</codeph> is <codeph>three</codeph>, the same as its name. </p> </li> </ul> <p>Names give reference counting objects an identity and are used when searching for a specific object or a group of related objects. </p> <p>See also: </p> <ul><li id="GUID-F24D4B6F-B263-5745-98B1-0DFB19C11819"><p> <xref href="GUID-C197C9A7-EA05-3F24-9854-542E984C612D.dita#GUID-C197C9A7-EA05-3F24-9854-542E984C612D/GUID-F3DA1084-412D-3EB7-AA1A-5B743FC93A93"><apiname>User::ValidateName()</apiname></xref>  </p> </li> <li id="GUID-ACBFD5F0-10EB-5010-A1CA-8F9CDAE31231"><p> <xref href="GUID-8EC6F10D-25D3-33BD-9B6F-53A96BFBF788.dita"><apiname>TFindHandleBase</apiname></xref>  </p> </li> </ul> </conbody></concept>