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.

Public Member Functions
TBaAssert()
TBaAssert(TErrorAction)
voidAssertDebL(TBool, TBafPanic)
voidAssertRelL(TBool, TBafPanic)
Private Member Functions
voidDoAssert(TBool, TBafPanic)
voidDoAssertL(TBool, TBool, TBafPanic)
voidDoLeaveL(TBafPanic)
Public Member Enumerations
enumTErrorAction { EPanic, ELeave }
Private Attributes
TErrorAction iErrorAction

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(TErrorActionaErrorAction)

Initializes TBaAssert object panic/leave behaviour.

Parameters

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

Member Functions Documentation

AssertDebL(TBool, TBafPanic)

voidAssertDebL(TBoolaAssertExprVal,
TBafPanicaPanic
)const

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

Parameters

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

AssertRelL(TBool, TBafPanic)

voidAssertRelL(TBoolaAssertExprVal,
TBafPanicaPanic
)const

The method panics/leaves if aAssertExprVal value is EFalse.

Parameters

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

DoAssert(TBool, TBafPanic)

voidDoAssert(TBoolaDebug,
TBafPanicaPanic
)const [private]

Parameters

TBool aDebug
TBafPanic aPanic

DoAssertL(TBool, TBool, TBafPanic)

voidDoAssertL(TBoolaAssertExprVal,
TBoolaDebug,
TBafPanicaPanic
)const [private]

Parameters

TBool aAssertExprVal
TBool aDebug
TBafPanic aPanic

DoLeaveL(TBafPanic)

voidDoLeaveL(TBafPanicaPanic)const [private]

Parameters

TBafPanic aPanic

Member Enumerations Documentation

Enum TErrorAction

Enumerators

EPanic
ELeave

Member Data Documentation

TErrorAction iErrorAction

TErrorAction iErrorAction[private]