Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CBase Class Reference

Container Base Class. More...

#include <e32base.h>

Inheritance diagram for CBase:
CActive CActiveScheduler CActiveSchedulerWait CArrayFixBase CArrayPakBase CArrayVarBase CBufBase CCamera CCirBufBase CCleanup CDir CFileBase CFont CFontCache CGraphicsContext CGraphicsDevice CObject CObjectCon CObjectConIx CObjectIx CPalette CPicture CPrinterControl CPrinterDriver CPrinterDriverUI CPrinterModelList CPrinterPort CSession2 CSubConParameterFamily CTrapCleanup CTypefaceStore CWsGraphic

Public Member Functions

 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Static Public Member Functions

static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 

Protected Member Functions

virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Detailed Description

Container Base Class.

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:

  1. A virtual destructor that 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().
  2. 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.

Note that using C++ arrays of CBase-derived types is not recommended, as objects in the array will not be zero-initialised (as there is no operator new[] member). You should use an array class such as RPointerArray instead for arrays of CBase-derived types.

See also
CleanupStack
API status
Published to all clients. Released API.

Definition at line 29 of file e32base.h.

Constructor & Destructor Documentation

◆ CBase()

CBase::CBase ( )
inline

Default constructor.

Definition at line 65 of file e32base.h.

◆ ~CBase()

IMPORT_C CBase::~CBase ( )
virtual

Virtual destructor.

Enables any derived object to be deleted through a CBase* pointer.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Delete()

static IMPORT_C void CBase::Delete ( CBase *  aPtr)
static

Deletes the specified object.

Parameters
aPtrPointer to the CBase derived object to be deleted.

(generated from Symbian Developer Library)

◆ Extension_()

IMPORT_C TInt CBase::Extension_ ( TUint  aExtensionId,
TAny *&  a0,
TAny *  a1 
)
protectedvirtual

Extension function.

(generated from Symbian Developer Library)

Reimplemented in CObject, CActive, CSession2, CServer2, CPolicyServer, and CActiveScheduler.

◆ operator new() [1/5]

TAny * CBase::operator new ( TUint  aSize)
inline

Allocates the object from the heap and then initialises its contents to binary zeroes.

Parameters
aSizeThe size of the derived class. This parameter is specified implicitly by C++ in all circumstances in which a derived class is allocated.

(generated from Symbian Developer Library)

◆ operator new() [2/5]

TAny * CBase::operator new ( TUint  aSize,
TAny *  aBase 
)
inline

Initialises the object to binary zeroes.

Parameters
aSizeThe size of the derived class. This parameter is specified implicitly by C++ in all circumstances in which a derived class is allocated.
aBaseIndicates a base address which is returned as the object's address.

(generated from Symbian Developer Library)

◆ operator new() [3/5]

TAny * CBase::operator new ( TUint  aSize,
TLeave   
)
inline

Allocates the object from the heap and then initialises its contents to binary zeroes.

Parameters
aSizeThe size of the derived class. This parameter is specified implicitly by C++ in all circumstances in which a derived class is allocated.

(generated from Symbian Developer Library)

◆ operator new() [4/5]

TAny * CBase::operator new ( TUint  aSize,
TLeave  ,
TUint  aExtraSize 
)
inline

Allocates the object from the heap and then initialises its contents to binary zeroes.

Use of this overload is rare.

Parameters
aSizeThe size of the derived class. This parameter is specified implicitly by C++ in all circumstances in which a derived class is allocated.
aExtraSizeIndicates additional size beyond the end of the base class.

(generated from Symbian Developer Library)

◆ operator new() [5/5]

TAny * CBase::operator new ( TUint  aSize,
TUint  aExtraSize 
)
inline

Allocates the object from the heap and then initialises its contents to binary zeroes.

Use of this overload is rare.

Parameters
aSizeThe size of the derived class. This parameter is specified implicitly by C++ in all circumstances in which a derived class is allocated.
aExtraSizeIndicates additional size beyond the end of the base class.

(generated from Symbian Developer Library)


The documentation for this class was generated from the following files: