Learning

Symbian OS Explained

Effective C++ Programming for Smartphones

By Jo Stichbury

Table of contents

1 Class Name Conventions on Symbian OS

Fundamental Types
T Classes
C Classes
R Classes
M Classes
Static Classes

2 Leaves: Symbian OS Exceptions

Leaving Functions
Heap Allocation Using new(ELeave)
Constructors and Destructors
Working with Leaving Functions
Trapping a Leave Using TRAP and TRAPD
LeaveScan

3 The Cleanup Stack

Using the Cleanup Stack
How Does the Cleanup Stack Work?
Using the Cleanup Stack with Non-CBase Classes
Using TCleanupItem for Customized Cleanup
Portability

4 Two-Phase Construction

5 Descriptors: Symbian OS Strings

Non-Modifiable Descriptors
Modifiable Descriptors
Pointer Descriptors
Stack-Based Buffer Descriptors
Heap-Based Buffer Descriptors
Literal Descriptors

6 Good Descriptor Style

Descriptors as Parameters and Return Types
Common Descriptor Methods
The Use of HBufC Heap Descriptors
Externalizing and Internalizing Descriptors
The Overuse of TFileName
Useful Classes for Descriptor Manipulation

7 Dynamic Arrays and Buffers

CArrayX Classes
RArray<class T> and RPointerArray<class T>
Why Use RArray Instead of CArrayX?
Dynamic Descriptor Arrays 103
Fixed-Length Arrays 104
Dynamic Buffers 106

8 Event-Driven Multitasking Using Active Objects

Multitasking Basics
Event-Driven Multitasking
Working with Active Objects
Example Code
Threads Without an Active Scheduler
Application Code and Active Objects

9 Active Objects under the Hood

Active Object Basics
Responsibilities of an Active Object
Responsibilities of an Asynchronous Service Provider
Responsibilities of the Active Scheduler
Starting the Active Scheduler
Nesting the Active Scheduler
Extending the Active Scheduler
Cancellation
Request Completion
State Machines
Long-Running Tasks
Class CIdle
Class CPeriodic
Common Mistakes

10 Symbian OS Threads and Processes

Class RThread
Thread Priorities
Stopping a Running Thread
Inter-Thread Data Transfer
Exception Handling
Processes

11 The Client–Server Framework in Theory

Why Have a Client–Server Framework?
How Do the Client and Server Fit Together?
How Do the Client and Server Communicate?
What Classes Does the Client–Server Framework Use?
How Do Synchronous and Asynchronous Requests Differ?
How Is a Server Started?
How Many Connections Can a Client Have?
What Happens When a Client Disconnects?
What Happens If a Client Dies?
What Happens If a Server Dies?
How Does Client–Server Communication Use Threads?
What Are the Implications of Server-Side Active Objects?
What Are the Advantages of a Local (Same-Process) Server?
What Are the Overheads of Client–Server Communication?
How Many Outstanding Requests Can a Client Make to a Server?
Can Server Functionality Be Extended?
Example Code

12 The Client–Server Framework in Practice

Client–Server Request Codes
Client Boilerplate Code
Starting the Server and Connecting to It from the Client
Server Startup Code
Server Classes
Server Shutdown
Accessing the Server

13 Binary Types

Symbian OS EXEs
Symbian OS DLLs
Writable Static Data
Thread-Local Storage
The DLL Loader
UIDs
The targettype Specifier

14 ECOM

ECOM Architecture
Features of an ECOM Interface
Factory Methods
Implementing an ECOM Interface
Resource Files
Example Client Code

15 Panics

Just-In-Time Debugging
Good Panic Style
Symbian OS Panic Categories
Panicking Another Thread
Faults, Leaves and Panics

16 Bug Detection Using Assertions

__ASSERT_DEBUG
__ASSERT_ALWAYS

17 Debug Macros and Test Classes

Heap-Checking Macros
Object Invariance Macros
.3 Console Tests Using RTest

18 Compatibility

19 Thin Templates

20 Expose a Comprehensive and Comprehensible API

21 Good Code Style

Appendices

Code Checklist
Glossary
Bibliography and Online Resources

 
book

Book facts

  • Author: Jo Stichbury
  • Published by Symbian Press
  • Publication date:October 2004
  • 365 pages
  • ISBN 0-470-02130-6

Buy from Amazon.com Buy from John Wiley & Sons

Bulk orders

To make a bulk order of this Symbian Press title:

Email Symbian Press sales

Terms of use | Privacy policy | Media Center | Contact us | © 2008 Symbian