Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Introduction to Swizzles and deferred loading

In complex applications involving a large network of objects, it may be desirable, and even necessary, to defer the loading of objects into memory from the store.

It should, therefore, be possible to represent such an object in one of two ways:

A Swizzle is a device for handling this dual representation.

A typical container type object, therefore, does not have a pointer directly to a contained object, but has a Swizzle which can represent that contained object either as a pointer or as a stream ID, as illustrated in the following diagram.

A Swizzle can be considered as a lean, but efficient, container in its own right.

The concrete Swizzle classes are templated; the template parameter defines the type of object which the Swizzle represents.

There are two general concrete Swizzle classes:

A TSwizzle<class T> represents a <class T> type object. Full access is available to the <class T> type object through the Swizzle.

A TSwizzleC<class T> represents a <class T> type object. Access to the object is limited; in particular the object cannot be changed.