Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: coemain.h
Link against: cone.lib

Class CCoeStatic

CCoeStatic

Support

Supported from 6.0

Description

Base class for creating singleton objects that will be stored by CCoeEnv. Each object must have a unique TUid.

The Symbian Platform does not provide writeable global static data. Singleton objects provide its equivalent in thread local storage — which is supported.

This behaviour is useful for objects in which only one copy is ever needed in the thread or application, e.g. in alert windows.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCoeStaticBase class for creating singleton objects that will be stored by CCoeEnv

Defined in CCoeStatic:
CCoeStatic(), EApp, EThread, TScope, ~CCoeStatic()

Inherited from CBase:
operator new()


Construction and destruction


CCoeStatic()

protected: CCoeStatic(TUid aUid,TScope=EThread);

Description

Constructor specifying a unique UID and the scope of the object.

Parameters

TUid aUid

The unique UID.

TScope

The scope of access to the object. By default, the object can be accessed from anywhere in the thread (EThread).


~CCoeStatic()

~CCoeStatic();

Description

Destructor.

[Top]


Enumerations


Enum TScope

TScope

Description

Scope of access to the singleton object.

EThread

Access from the entire thread.

EApp

Access from an appUi in that thread.