17.4 Coding Conventions and Standards

This section describes the steps that need to be taken to define a new class. Every class based on the taBase type (i.e., all classes in the PDP++ software) needs to have a set of standard methods (member functions) that allow it to interface with the rest of the software. Also, many commonly occurring data types and tasks that a class needs to perform have been dealt with in a standardized way. This chapter familiarizes the programmer with these standards and interfaces.

Defining a new class is typically the first step a user will take in programming with the PDP++ software. This is because the software is designed to be extended, not revised, by the user. Fortunately, most everything that is done by the PDP++ library code can be overwritten by defining a new class that does something differently, or simply by adding on to what the existing code does. Both of these approaches require the definition of a new class.

The first step in defining a new class is figuring out which existing class to base the new one on. This requires a knowledge of the existing class structure, which is covered in this manual. Once this has been decided, the guidelines in this section should be followed as closely as possible. It is assumed that the reader knows C++ and the basic ideas about constructors, destructors, virtual vs. non-virtual functions, etc.