Symbian3/SDK/Source/GUID-83BE15D8-511F-592D-A93B-C71BD6FB1B08.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 xml:lang="en" id="GUID-83BE15D8-511F-592D-A93B-C71BD6FB1B08"><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 OS. </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 OS when Symbian OS is built. </p> </li> </ul> <section><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 OS 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_d0e66504_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><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>