Using SoftBench Class Graph/Editor

Sample Use Models

or function template member (parameterized function). (You may want to use SoftBench Class Graph/Editor to create a class with the desired components, and then convert that class to a template using another editor.) However, you can perform any other operation with class templates, such as adding or removing member functions and data members, and deriving classes from the template.

When you derive a class from a class template, SoftBench Class Graph/Editor prompts you for the template parameters. You cannot derive a class directly from a template; you must derive from an instance of the template. When you enter the parameters, SoftBench Class Graph/Editor references a template instance of the appropriate type (creating one if necessary), and derives the new class from the template instance.

For example, suppose you have a template A that accepts one parameter. If you specify an inheritance relationship between A and a class B, SoftBench Class Graph/Editor prompts you to enter the template parameter. If you enter "int", SoftBench Class Graph/Editor creates a class (template instance) A<int>, and derives B from A<int>. If you want to derive other classes from an int instance of A, specify A<int> as the base class.

Using Configuration Management

SoftBench Class Graph/Editor attempts to edit all files containing updated class information. (A single change may affect many files. For example, if you change the name of a class, every reference to that class must be updated.) SoftBench Class Graph/Editor assumes any read-only files are locked by your configuration management system. SoftBench Class Graph/Editor displays a dialog box to give you the option of checking out the files. The dialog box also allows you to simply chmod the files to force them to be writeable. You should not do this if the files are actually locked by the CM system, since the changes you make may be lost when you check out the file. Only force the files to be writeable if no CM system manages them.

142

Chapter 5