Home · All Classes · Main Classes · Deprecated
Static Public Member Functions | Static Protected Attributes

MComponentCache Class Reference

MComponentCache contains objects instantiated before running main(). More...

List of all members.

Static Public Member Functions

static MApplicationmApplication (int &argc, char **argv, const QString &appIdentifier=QString(), MApplicationService *service=0)
static MApplicationWindowmApplicationWindow ()
static void populateForMApplication ()
static void populateForWRTApplication ()
static bool populating ()

Static Protected Attributes

static MComponentCachePrivate
*const 
d_ptr = new MComponentCachePrivate

Detailed Description

MComponentCache contains objects instantiated before running main().

MComponentCache enables performance boost on application start-up times by offering a storage for objects instantiated and initialized before launching the application.

Launchers like applauncherd populate this cache before loading the application binary. The application should pick up the objects fromt the cache instead of creating new ones. In particular, the MApplication instance must be read from the cache as follows. For instance, replace

MApplication myApp(argc, argv);

by

MApplication *myApp = MComponentCache::mApplication(argc, argv);

As a consequence, this prevents inheriting MApplication in applications that use MComponentCache.

If the launcher has not populated the cache, this will create a new MApplication instance. Thus the same application work with and without the launcher.

The ownership of the objects returned from the cache is passed to the caller.


Member Function Documentation

MApplication * MComponentCache::mApplication ( int &  argc,
char **  argv,
const QString appIdentifier = QString(),
MApplicationService service = 0 
) [static]

Returns MApplication instance from the cache or creates a new one.

Parameters are the same as in MApplication::MApplication(). Ownership of the returned object is passed to the caller.

MApplicationWindow * MComponentCache::mApplicationWindow (  )  [static]

Returns MApplicationWindow instance from the cache or creates a new one.

Ownership of the returned object is passed to the caller.

void MComponentCache::populateForMApplication (  )  [static]

Populates cache for the use of an ordinary Meegotouch application, called by the launcher.

void MComponentCache::populateForWRTApplication (  )  [static]

Populates cache for the use of a web runtime application, called by the launcher.

bool MComponentCache::populating (  )  [static]

Returns true if cache is currently being populated, otherwise false.


Member Data Documentation

MComponentCachePrivate *const MComponentCache::d_ptr = new MComponentCachePrivate [static, protected]

Copyright © 2010 Nokia Corporation
MeeGo Touch