Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Using TSwizzle<class T>


Using the conversion to T* operator

In the following code fragment, the compiler invokes the T*() operator (because a pointer is required) for the TSwizzle<CClassB> object iB, before calling delete.

CClassABC::~CClassABC()
    {
    ...
    if (iB.IsPtr())
        delete iB;
    }

[Top]


Using the indirection operator

In the following code fragment, the *() operator returns a reference to the CClassB object represented by the swizzle TSwizzle<CClassB> object, iB.

TStreamId CClassABC::StoreL()
    {
    ...
    outstream << *iB;
    ...
    }

[Top]


Using the indirect component selector

In the following code fragment, the operator -> gives access to the member iFixBuf of the CClassB object which is represented by the TSwizzle<CClassB> swizzle, iB.

void CClassABC::ConstructB(...,...,...,...)
    {
    iB->iFixBuf = aData;
    ...
    }