What is Class++TM


Class++ is a low-cost programmable C++ class generator that allows programmers to quickly customize and generate new class files with an absolute minimum of editing. Typically, you only need to specify two or three names before generating the source files (cpp and h or hpp).

  Changes to one instance of a common field, such as the Class Name, are immediately propagated throughout both the class header and definition files.

  Class Name edits can be propagated to File Name fields via an alterable Class -> File Rule. The base File Name of the generated files is directly derived from the Class Name using the same rule.

  Entire sections (called Phrases) can be enabled or disabled with a mouse click, allowing you to quickly include or exclude forms such as RTTI, copy constructors, assignment operators, serialization, class-specific new, CRC checking, instance counting, and debugging code.

  Class form variations can be predefined in Templates to further reduce the necessary modifications before file generation. For example, Class++ comes with predefined templates for abstract base classes and standalone classes both with and without MFC support.

  Automatic syntax coloring with user-defined colors makes Class++ read like your favorite programming editor. Phrases and Fields can be visually positioned using drag and drop or edited directly using the embedded Class Markup Language.

Templates:  Templates contain specific class structures common to different class metaphors. You can create any number of templates tailored to different class forms to further simplify the creation of new classes. Each template contains the class definition (the cpp file) and the class header (the h or hpp file).

Organizations can use templates to encourage or enforce coding idioms, conventions and/or styles!

Template pages are constructed from a series of sequential Phrases that can be related to other phrases with the same Phrase ID (identifier) or entirely unrelated to other parts of the class. Two phrases with the same ID will operate together. For example, if you disable one phrase the other will automatically be disabled too - even across pages! This is a good way to include or exclude related code such as MFC support or RTTI.

The New, Open, Save, and Save As file commands operate on templates, loading and storing both template pages automatically. Similarly, the file MRU pick list opens the most recently accessed templates. Each template has its own Class -> File Rule that defines how the target file name base (without the file extension) is derived from the Class Name field(s) content.

Phrases:  Phrases are constructed from Fields of passive and/or active text. Phrases can contain any number of text fields which can generate any number of lines of text. Below is a picture of five separate phrases with the third phrase selected (highlighted).

Selected Phrase Picture

Phrases can be edited visually using the mouse and dialogs or directly via the embedded CML (Class Markup Language) that describes fields and their content. A phrase can be opened for visual editing by double-clicking the phrase (or use the Edit or right-click menus). When a phrase is being visually edited it looks like this:

Visual Edit Phrase Picture

You can see the five phrases but only the third phrase is active for editing. In this example, a Class Name field is selected for editing. Editing this field would alter all of the other occurrences of CTemplate in the surrounding text (including fields in the inactive phrases and fields in phrases on the other template page).

Phrase IDs:  Every phrase has an optional ID that can be set from the ID Bar which can dock in the toolbar or status bar or float in its own window. Whenever you click on a phrase, its ID (if any) appears in the ID Bar window. Click in the ID Bar window to edit IDs to any alphanumeric value.

IDs do not have to be unique. In fact, when two (or more) phrases have the same ID they are "ganged" together - when one phrase is enabled so are the other (same ID) phrases. This feature allows you to tie phrases in the code page to phrases in the header so that enabling or disabling a declaration in the header automatically enables or disables the corresponding implementation!
Fields:  Each phrase is composed of a series of fields of which there are five types:


Let's break down our example phrase which happens to contain all five field types. The first field is an Access Keyword:

Phrase Access Field Picture

Access Keyword text is restricted to: public; protected; and private. You can change the text by using the right-click menu (right click over the field and select the access keyword you want).

Next we see a Propagated Name which happens to be a Class Name field that defines the name of the class throughout the definition and header files:

Phrase Name Field Picture

Propagated Name fields are just like Text String fields except for the important property of propagation. Whenever a Propagated Name field's text is altered, the changes also occur in all Propagated Name fields that have the same ID as the edited field. These changes are broadcast across both template pages.

A Text String follows the Class Name field to finish the constructor declaration:

Phrase Text Field Picture

Text Strings can have IDs too, but their text edits are not propagated - only their enable/disable changes are propagated and only to Text String fields with the same ID, of course.

A Virtual Keyword field begins the last line in this phrase:

Phrase Virtual Field Picture

Virtual Keyword text is not alterable. Virtual Keywords can only be enabled and disabled. Naturally, Virtual Keyword fields with IDs are "ganged" together just like the previous fields. Enable one Virtual Keyword field and all other similar fields with the same ID are also enabled.

Finally, we have an Abstract Notation field that declares this class as an abstract base class:

Phrase Abstract Field Picture

Like Virtual Keywords, Abstract Notation fields do not have alterable text. These fields can only be enabled or disabled. You can assign IDs to these fields also, but it would be an unusual situation that warranted "ganging" these fields together.


Home Page  •  Page Index