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

MComponentCache Class Reference

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

Collaboration diagram for MComponentCache:
Collaboration graph
[legend]

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 void cleanupCache ()

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.

Definition at line 64 of file corelib/core/mcomponentcache.h.


Member Function Documentation

void MComponentCache::cleanupCache (  )  [static]

Definition at line 310 of file mcomponentcache.cpp.

{
#ifdef QT_OPENGL_LIB
    while (!d_ptr->shareWidgetsCache.isEmpty()) {
        MComponentCachePrivate::FormatWidgetPair pair = d_ptr->shareWidgetsCache.takeFirst();
        delete pair.second;
    }
#endif
}

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.

Definition at line 320 of file mcomponentcache.cpp.

{    
    return d_ptr->mApplication(argc, argv, appIdentifier, service);
}

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.

Definition at line 325 of file mcomponentcache.cpp.

{
    return d_ptr->mApplicationWindow();
}

void MComponentCache::populateForMApplication (  )  [static]

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

Definition at line 295 of file mcomponentcache.cpp.

{
    d_ptr->populateForMApplication();
}

void MComponentCache::populateForWRTApplication (  )  [static]

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

Definition at line 300 of file mcomponentcache.cpp.

{
    d_ptr->populateForWRTApplication();
}

bool MComponentCache::populating (  )  [static]

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

Definition at line 305 of file mcomponentcache.cpp.

{
    return d_ptr->populating();
}


Member Data Documentation

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

Definition at line 93 of file corelib/core/mcomponentcache.h.


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:24 (PDT)
Doxygen 1.7.1
MeeGo Touch