Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <COEMAIN.H>
Link against: cone.lib

Class CCoeStatic

class CCoeStatic : public CBase;

Description

Base class for creating singleton objects that will be stored by CCoeEnv.

Each object must have a unique TUid.

Symbian OS 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

Members

Defined in CCoeStatic:

Inherited from CBase:


Construction and destruction


~CCoeStatic()

IMPORT_C ~CCoeStatic();

Description

Destructor.


CCoeStatic()

protected: IMPORT_C CCoeStatic();

Description


CCoeStatic(TUid,TScope)

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

Description

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

Parameters

TUid aUid

The unique UID.

CCoeStatic::TScope


CCoeStatic(TUid,TInt,TScope)

protected: IMPORT_C CCoeStatic(TUid aUid, TInt aDestructionPriority, TScope aScope=EThread);

Description

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

Parameters

TUid aUid

The unique UID.

TInt aDestructionPriority

Priority determining the order of destruction relative to other CCoeStatic-derived objects. The higher the destruction-priority of the object, the earlier that object is deleted. Objects with a positive destruction-priority are destroyed before the CCoeAppUi object is destroyed. Objects with a negative destruction-priority are destroyed after the CCoeAppUi object is destroyed.

CCoeStatic::TScope aScope

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

[Top]


Member functions


CCoeStatic_Reserved1()

private: IMPORT_C virtual void CCoeStatic_Reserved1();

Description


CCoeStatic_Reserved2()

private: IMPORT_C virtual void CCoeStatic_Reserved2();

Description

[Top]


Member 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.


Enum anonymous

n/a

Description

The default destruction priority if none is specified in the constructor

EDefaultDestructionPriority