Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32cmn.h

TRAP_IGNORE

TRAP_IGNORE (_s) {                                                      \
    { TRAP_INSTRUMENTATION_START; }                         \
    try {                                                  \
        __WIN32SEHTRAP                                      \
        TTrapHandler* ____t = User::MarkCleanupStack();     \
        _s;                                                 \
        User::UnMarkCleanupStack(____t);                    \
        { TRAP_INSTRUMENTATION_NOLEAVE; }                   \
        __WIN32SEHUNTRAP                                    \
        }                                                   \
    catch (XLeaveException& l)                              \
        {                                                   \
        l.GetReason();                                      \
        { TRAP_INSTRUMENTATION_LEAVE(l.Reason()); }         \
        }                                                   \
    catch (...)                                             \
        {                                                   \
        User::Invariant();                                  \
        }                                                   \
    { TRAP_INSTRUMENTATION_END; }                           \
    }

Description

Executes the set of C++ statements _s under a trap harness. Any leave code generated is ignored.

Use this macro as a C++ statement.

This macro is functionally equivalent to:

    TInt x;
    TRAP(x,_s)

or

    TRAPD(x,_s)

where the value in 'x' is not used by any subsequent code.

Use this macro as a C++ statement.

_s can consist of multiple C++ statements; in theory, _s can consist of any legal C++ code but in practice, such statements consist of simple function calls, e.g. Foo() or an assignment of some value to the result of a function call, e.g. functionValue=GetFoo().

A cleanup stack is constructed for the set of C++ statements _s. If any function in _s leaves, objects pushed to the cleanup stack are cleaned-up. In addition, if any of the C++ statements in _s leaves, then remaining C++ code in _s is not executed and any variables which are assigned within that remaining code are not defined.

Parameters

_s

C++ statements which will be executed under a trap harness.