Symbian3/SDK/Source/GUID-83BE15D8-511F-592D-A93B-C71BD6FB1B08.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?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-83BE15D8-511F-592D-A93B-C71BD6FB1B08" xml:lang="en"><title>What
are tables</title><shortdesc>This topic describes the structure of a table. A table is an item
that can be stored in the Comms Database. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>A table is a set of records. All records in a table are the same type.
A table is also a container and an element. </p>
<p>There are two types of table: </p>
<ul>
<li id="GUID-C7ECF6E7-7011-5C3C-892C-CD8A11258309"><p>a table that has records
defined at system compile time - these records have named fields and are defined
by Symbian platform. </p> </li>
<li id="GUID-D7BCD0AA-ECCC-500C-991A-1484F4970A2A"><p>a table that consists
of records defined at run time - these records are user defined records -
they are not known to Symbian platform when Symbian platform is built. </p> </li>
</ul>
<section id="GUID-89CEA8F2-9B19-4283-B658-F832ED5ED4DE"><title>Tables that have records defined at system compile       
   time</title> <p>A table that has records defined at system compile time
is represented by the templated class <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBRecordSet</apiname></xref> <codeph>&lt;T&gt;</codeph>.
The template parameter defines the record type. The template parameter is
a Symbian platform defined record. </p> <p>You create a table
object on the heap. You use the <codeph>new           (Eleave)</codeph> construction
to create this object. </p> <fig id="GUID-6B7087D6-BA28-578D-8BF8-83FFC9486FB0">
<image href="GUID-DB571D42-03F4-50F9-974D-B905707FC5F4_d0e79867_href.png" placement="inline"/>
</fig> <p>The CommsDat API implements the table as an array of records and
uses <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>RPointerArray</apiname></xref> <codeph>&lt;T&gt;</codeph> as
the array. The CommsDat API implements <codeph>RPointerArray&lt;T&gt;</codeph> in
the base class <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBRecordSetBase</apiname></xref>, because
this behaviour is common to all tables. Tools and applications can access
the array and can use the sort behaviour provided by <codeph>RPointerArray&lt;T&gt;</codeph> to
sort records. </p> </section>
<section id="GUID-0FA81D0A-3CB9-41E7-AA21-0DB074A4AC2D"><title>Tables that have user defined records</title> <p>A table that
has user defined records is represented by the <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBGenericRecord</apiname></xref>.
The class has the behaviour that allows it to represent a record and a set
of records. Internally, the class has an array that can contain the records. </p> <p>You
use the <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CommsDat::CCDRecordBase::RecordFactoryL()</apiname></xref> factory
function to create a <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBGenericRecord</apiname></xref> object. </p> </section>
</conbody></concept>