BaseClasses Information
BaseClasses are used in Noesis as building blocks to create components. The purpose of a base class is implementing one or more interfaces and provide proper virtual functions to be overriden by the concrete classes. The virtual functions offered to the concrete classes are usually not the virtual functions appearing in the public interfaces. Base classes transform the public interfaces (the face offered to the users of the interface) to internal virtual functions (the face offered to the implementer of the interface). The pattern recommended for this task is the Non-Virtual Interface.
All base classes should follow:
- The base class should be abstract. In Noesis we usually enforce this using a virtual pure destructor
- The base class should be non-copyable (copy constructor and assignment operator in the private section)
- The destructor is protected. Components cannot be deleted because they are reference counted. The Release() should be used instead.