Symbian3/SDK/Source/GUID-5875C752-12A9-5819-90D9-CAAE48F1A5C5.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

<?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 id="GUID-5875C752-12A9-5819-90D9-CAAE48F1A5C5" xml:lang="en"><title>Using
CArrayFixSeg&lt;TAny&gt;</title><shortdesc>The <codeph>CArrayFixSeg&lt;TAny&gt;</codeph> is useful for constructing
an array of fixed length buffers, where the length is decided at run time.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-C0F44785-6E5F-447D-B1AC-F5187527D73F"><title>Arrays whose type is not known until class instantiation</title> <p>The <codeph>CArrayFixSeg&lt;TAny&gt;</codeph> is
useful for constructing an array of fixed length buffers, where the length
is decided at run time. It is also useful as a data member of a base class
in a thin template class/base class pair where the type of the array element
is not known until the owning thin template class is instantiated.</p> <p>For
example, to implement a stack of fixed length objects of type <codeph>T</codeph>.</p> <codeblock id="GUID-F707A19F-A9C0-5704-973B-11A0087F714D" xml:space="preserve">class CExampleBase : public CBase
 {
public :
 ...
protected :
 ...
 void  PushL(const TAny* aPtr);
 TAny* Pop();
private :
 CArrayFixSeg&lt;TAny&gt; iArray;
 }</codeblock> <codeblock id="GUID-8DA14B1F-3771-56F8-9C15-4E1BB0AC68CE" xml:space="preserve">template &lt;class T&gt;
class CExample : public CExampleBase
 {
public :
 ...
 inline void PushL(const T* aPtr);
 inline T*   Pop();
 }</codeblock> </section>
</conbody></concept>