×
Namespaces

Variants
Actions

CBase

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: tote_b5 (22 Mar 2007)
Last edited: hamishwillee (20 Jul 2012)

CBase is the 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' (hence they're called C classes).

The class has three important features:

  • A virtual destructor that allows instances of derived classes to be destroyed and properly cleaned up through a CBase* pointer.
  • Initialisation of the CBase derived object to binary zeroes meaning 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.
  • private copy-constructor and assignment operator to prevent making "shallow copies" of objects.
This page was last modified on 20 July 2012, at 02:01.
52 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×