Symbian3/SDK/Source/GUID-83BE15D8-511F-592D-A93B-C71BD6FB1B08.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <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
       
    13           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
       
    14           (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>