Namespaces
Variants
Actions

CBase

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 05:01.
106 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved