TBaAssert Class Reference

class TBaAssert

TBaAssert class has two methods: AssertDebL and AssertRelL, which can do a panic or leave depending on the iErrorAction value. If the TBaAssert object is created with TBaAssert::ELeave constant, then AssertDebL/AssertRelL methods will leave when called (if aAssertExprVal argument is EFalse). If the TBaAssert object is created with TBaAssert::EPanic constant, then AssertDebL/AssertRelL methods will panic when called (if aAssertExprVal argument is EFalse). If the TBaAssert object is created using the default constructor - by default the methods will panic. The class size has to be exactly sizeof(enum), because objects of that class are used in some legacy code - replacing an existing enum data member.

Constructor & Destructor Documentation

TBaAssert()

TBaAssert ( )

By default TBaAssert methods will panic. An error will be issued at compile time if the class size is not sizeof(TBaAssert::TErrorAction).

TBaAssert(TErrorAction)

TBaAssert ( TErrorAction aErrorAction )

Initializes TBaAssert object panic/leave behaviour.

Parameters

TErrorAction aErrorAction - TBaAssert::EPanic or TBaAssert::ELeave.

Member Functions Documentation

AssertDebL(TBool, TBafPanic)

void AssertDebL ( TBool aAssertExprVal,
TBafPanic aPanic
) const

The method panics/leaves if aAssertExprVal value is EFalse. The panic will be raised only in the DEBUG build.

Parameters

TBool aAssertExprVal If EFalse, the method panics/leaves.
TBafPanic aPanic Panic code. If the method must leave, the code will be mapped to some Symbian OS error code.

AssertRelL(TBool, TBafPanic)

void AssertRelL ( TBool aAssertExprVal,
TBafPanic aPanic
) const

The method panics/leaves if aAssertExprVal value is EFalse.

Parameters

TBool aAssertExprVal If EFalse, the method panics/leaves.
TBafPanic aPanic Panic code. If the method must leave, the code will be mapped to some Symbian OS error code.

DoAssert(TBool, TBafPanic)

void DoAssert ( TBool aDebug,
TBafPanic aPanic
) const [private]

Parameters

TBool aDebug
TBafPanic aPanic

DoAssertL(TBool, TBool, TBafPanic)

void DoAssertL ( TBool aAssertExprVal,
TBool aDebug,
TBafPanic aPanic
) const [private]

Parameters

TBool aAssertExprVal
TBool aDebug
TBafPanic aPanic

DoLeaveL(TBafPanic)

void DoLeaveL ( TBafPanic aPanic ) const [private]

Parameters

TBafPanic aPanic

Member Enumerations Documentation

Enum TErrorAction

Enumerators

EPanic
ELeave

Member Data Documentation

TErrorAction iErrorAction

TErrorAction iErrorAction [private]