Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 02:01, 20 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


From Wiki
Jump to: navigation, search
Article Metadata
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.
28 page views in the last 30 days.