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