Location:
e32base.h
Link against: euser.lib
CBase
Supported from 5.0
Base class for all classes to be instantiated on the heap.
By convention, all classes derived from CBase
have a
name beginning with the letter 'C'.
The class has two important features:
A virtual destructor - this allows instances of derived classes to
be destroyed and properly cleaned up through a CBase*
pointer. All
CBase
derived objects can be pushed, as CBase*
pointers, onto the cleanup stack, and destroyed through a call to
CleanupStack::PopAndDestroy()
.
Initialisation of the CBase
derived object to binary
zeroes through a specific CBase::operator new()
- this means that
members, whose initial value should be zero, do not have to be initialised in
the constructor. This allows safe destruction of a partially-constructed
object.
Defined in CBase
:
operator new()
, ~CBase()
TAny* operator new(TUint aSize,TAny* aBase);
TAny* operator new(TUint aSize,TLeave aLeave);
TAny* operator new(TUint aSize);
TAny* operator new(TUint aSize,TUint anExtraSize);
Allocates the object from the heap and then initialises its contents to binary zeroes.
|
|