Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Internalising a Swizzle

Internalising a Swizzle from a stream has assignment semantics.

The process of internalisation assumes that the current position within the stream contains the external representation of a stream ID. The stream which corresponds to this ID contains the external representation of some object.

The result is a Swizzle which represents the object by stream ID.

The following code fragments illustrate the process.

iB is a CClassB type component of a class CClassABC, and is represented by a Swizzle. The data member is defined as:

class CCClassABC : public CBase
    {
    ...
    TSwizzle<CClassB> iB;
    ...
    }

The example assumes that the stream ID of the swizzled object has been externalised as in Externalizing a Swizzle.

CClassB's RestoreL() and InternalizeL() functions are implemented as:

void CClassABC::RestoreL()
          {
          RStoreReadStream stream;
          stream.OpenLC(iStore,iId);
          InternalizeL(stream);
          CleanupStack::PopAndDestroy();
          }

void CClassABC::InternalizeL(RReadStream& aStream)
          {
          ...
          aStream >> iB; // internalises Swizzle from stream
          ...
          }

Here, iId is the stream ID containing CClassABC data.