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 over the next few weeks. Thanks for all your past and future contributions.
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.