Symbian3/SDK/Source/GUID-FBE448A4-4728-5EE5-84F2-4790735857B3.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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-FBE448A4-4728-5EE5-84F2-4790735857B3" xml:lang="en"><title>Basic
Types Overview</title><shortdesc>This document is an overview of the basic types.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-2307C342-3787-4B91-A57E-D5E1A65A48D4"><title>Purpose</title> <p>Provides implementation-independent versions
of the C++ built-in types, defines the Symbian platform standard base class
for all heap-allocated classes, and provides some useful yet simple global
functions.</p> <p>You should avoid using the C++ built-in types directly:
always use the Symbian platform types instead.</p> </section>
<section id="GUID-CB087D7D-6963-40C0-809A-AB75B656C39E"><title>Description</title> <p>The API defines classes and typedefs
for integer, text, Boolean, and floating point types. Additionally, a utility
class to help with reference arguments in variable argument functions is provided.</p> <p><b>Heap-allocated classes base</b> </p> <p>Symbian platform requires that
all classes that own dynamically allocated resources derive from a standard
base class, <xref href="GUID-8F6FE089-E2A8-30F4-B67E-10F286347681.dita"><apiname>CBase</apiname></xref>. Such classes by conventions have a C
prefix to their name, and so are referred to as C classes. C classes, and
their associated allocation and cleanup idioms, are fundamental to Symbian
platform. </p> <p><b>Integral
types</b> </p> <p><xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> is the natural machine word integer
and should be used in all general contexts where integer arithmetic is desired.</p> <p><xref href="GUID-49ACAE7B-1FE4-3BA6-8772-F104D3F01E41.dita"><apiname>TInt32</apiname></xref>, <xref href="GUID-6BE0B3FC-2B36-3982-AA51-971F3354925E.dita"><apiname>TInt16</apiname></xref> and <xref href="GUID-F2669E84-D47E-3C83-A549-D77A883787CC.dita"><apiname>TInt8</apiname></xref> map onto C++ built-in types in most implementations. These
types should only be used where the size of the integer is of first importance.</p> <p><xref href="GUID-F9432D7B-41C9-3048-AC50-B5BCF8BE11D0.dita"><apiname>TUint</apiname></xref> is
an unsigned integer of the natural machine word size. It should be used for
flag and handle words, which are manipulated using bitwise and equality-comparison
operations rather than arithmetic. </p> <p><xref href="GUID-F58A1C0D-1B36-37EA-8012-1C74B2D12CAD.dita"><apiname>TUint32</apiname></xref>, <xref href="GUID-4BB532F8-938E-37C7-9D40-6010EB716E7A.dita"><apiname>TUint16</apiname></xref> and <xref href="GUID-F894527F-13A6-3E6D-BA7B-187812CDF20E.dita"><apiname>TUint8</apiname></xref> are
available where the specific representation width is important.</p> <p><b>Text types</b> </p> <p><xref href="GUID-317497AE-D70D-3FD5-9865-6446FF4AD035.dita"><apiname>TText</apiname></xref> represents a character
in the natural width for the Symbian platform build. From v5.1 onwards, this
is 16 bits.</p> <p><xref href="GUID-0DC8E9A8-8B5A-3566-B1C5-27B6E4F47F3C.dita"><apiname>TText8</apiname></xref> is available for build-independent
8-bit characters, and <xref href="GUID-9A863E0A-E588-367C-9444-C13AC0D44234.dita"><apiname>TText16</apiname></xref> for build-independent 16-bit
characters. </p> <p>The <xref href="GUID-CDCFA2A5-EA8A-3B39-B90F-77AC41571E2D.dita"><apiname>TChar</apiname></xref> class wraps a character value
and provides a number of utility functions to operate upon it.</p> <p><b>Boolean type</b> </p> <p><xref href="GUID-4B942C06-1BAC-3A21-B3B1-89FB5C51ADA0.dita"><apiname>TBool</apiname></xref> represents a Boolean
whose value may be true or false. It is implemented as a natural machine-word
integer.</p> <p><b>Floating-point
types</b> </p> <p><xref href="GUID-2D851BBB-15A1-309A-813D-E397D55A6431.dita"><apiname>TReal</apiname></xref> is a 64-bit double-precision type,
used as the argument type for all math functions, and the default type of
floating-point literals.</p> <p><xref href="GUID-E694921E-0449-3B0B-81DC-5A9FCC07B345.dita"><apiname>TReal64</apiname></xref> and <xref href="GUID-58CA4B68-0A0F-31E2-A624-0F78F47EE458.dita"><apiname>TReal32</apiname></xref> are
available when the precise size is important.</p> <p><b>Value reference type</b> </p> <p>The value reference type is a utility
that is provided to overcome problems with specifying a C++ reference argument
before the ellipsis argument in variable argument functions.</p> <p>The value
reference type is provided by <xref href="GUID-5391E485-A019-358F-85D2-3B55BA439BD1.dita"><apiname>TRefByValue</apiname></xref> &lt;T&gt;.</p> <p><b>Global functions</b> </p> <p><xref href="GUID-B22DC2FB-FA5C-5F62-8F01-A975EAA24E7F.dita">Max()</xref>, <xref href="GUID-B22DC2FB-FA5C-5F62-8F01-A975EAA24E7F.dita">Min()</xref>, <xref href="GUID-B22DC2FB-FA5C-5F62-8F01-A975EAA24E7F.dita">Rng()</xref> and <xref href="GUID-B22DC2FB-FA5C-5F62-8F01-A975EAA24E7F.dita">Abs()</xref> are simple global
functions that are useful in many contexts.</p> </section>
<section id="GUID-93D4AD68-48DE-4FB1-A0E9-F8DB1487DFD8"><title>See also</title> <p><xref href="GUID-07A31FD0-304A-57CA-8FFE-4DAD8EE9B30F.dita">Maths
Overview</xref> </p> </section>
</conbody></concept>