Chapter 7. C++ Browser Reference

This chapter describes in detail the function of each window, menu, keyboard accelerator, and display in the C++ Browser user interface. For a task-oriented description of commonly used functions, refer to Chapter 6, “Using the C++ Browser: A Sample Session.”

This chapter contains the following sections:

Class View Window

Class View is the primary C++ Browser window (see Figure 7-1). It opens when you select “C++ Browser” from the Admin menu of the WorkShop Static Analyzer. Class View displays class members and related classes of a selected class, called the current class. Class View lets you perform a variety of static analysis database queries using the display. Detailed query results can be displayed in Source Views and in the Static Analyzer. You can launch graphical views of classes or calls from the Class View window to enhance the information. Also, you can generate reference pages from Class View.

Figure 7-1. Class View Window Elements


The next sections describe the function of each element of the Class View window.

Class View Menu Bar

This section describes the menus found in the menu bar of the Class View window (see Figure 7-2). By choosing the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, and is thus always visible. Some menus contain submenus, which can also be torn off and displayed in separate windows. Finally, this section provides an alphabetical lookup table of the keyboard accelerators that are shortcuts for many of the menu selections.

Figure 7-2. Class View Menu Bar


Admin Menu

The Admin menu contains commands for selecting a new current class, for manipulating Class View windows, generating reference pages (man pages), and exiting the Class View.

“Change Current Class” 


lets you select a new current class without manually typing it into the current class text field. Choosing this command opens a class chooser window (List Of Classes, see Figure 7-3) that contains a scrolling list of all the classes available from the current fileset. To select a class, choose one from the list by clicking on it with the left mouse button and then pressing the Accept button. To select a class and simultaneously close the chooser window, click on the item and then click on the OK button, or simply double-click on the item in the list. The Cancel button closes the chooser window without changing the current class.

Figure 7-3. List of Classes Chooser Window


“Another Class View” 


creates an identical copy of the Class View window. All current information displayed within the initial window is preserved by the copy, but connections to Class Graph and Call Graph windows are not carried over to the new Class View window.

“Close Class View” 


shuts the Class View window from which the command was selected. Also, any associated windows, such as Graph or List of Classes, are shut.

“Generate Man Pages...” 


opens a Man Page Generator window that lets you create reference page templates for classes (see Figure 7-4). For a tutorial about using this feature, refer to “Generating Reference (Man) Pages”.

Select individual classes by clicking on them. To start over with no classes selected, click Unselect All. If you want a reference page for every class in the list, click Select All. Clicking the Generate button creates a reference page template for each selected class. If reference pages exist for selected classes, the browser warns you, unless you toggle Warn Overwrite: to No.

Output files go in the directory shown in the Man Page Directory field, if it exists. To specify a different output directory using the Select Man Page Directory dialog box, click the Set Directory button in the Man Page Generator window.

Figure 7-4. Reference Page Generation


“Exit Browser” 

quits the C++ Browser, closing all windows launched from it (except Source View). The Static Analyzer window from which the browser was launched is not affected.

Views Menu

Figure 7-5. Views Menu


The Views menu contains commands for opening windows with graphical views, as shown in Figure 7-5. For descriptions of the display and controls, refer to “Class Graph and Call Graph Displays”. Each of the first four selections opens a Class Graph window for the current class, with a specific relationship; refer to “Class Graph Window”. The last selection opens a Call Graph window; refer to “Call Graph Window”.

“Show Inheritance Graph” 


describes the relationship between base classes and derived classes.

“Show Containment Graph” 


describes the relationship of container classes to the classes they use as components.

“Show Interaction Graph”  


describes the relationship of used classes to the classes that are their users.

“Show Friend Graph” 


describes the relationship of classes declaring friends to the classes they declare.

“Show Call Graph” 


opens a Call Graph window. To operate on it, choose a current class from the “List Of Classes” chooser window. Then select a method from the member list display (left list on the Class View window). Press right mouse button to pop up the “Queries on Methods” menu and choose one of the commands in the “Call Graph” submenu. This menu provides a more selective view than is available in the Static Analyzer.

History Menu

Figure 7-6. History Menu


The History menu contains commands that let you quickly select previously chosen classes for display in the Class View window (see Figure 7-6). If no class was selected previously, a message appears.

“Show Previous Class” 


sets the current class to the previously displayed class and the information in the Class View window changes to reflect this.

“Show History” 


opens a “List of Classes Shown” chooser window (see Figure 7-7) that presents the list of previously displayed current classes in chronological order, with the most recently displayed class at the bottom of the list.

To select a class, choose one from the list by clicking on it with the left mouse button, and then press the Apply button. To select a class and simultaneously close the chooser window, click on the item and then click on the OK button, or simply double-click on the item in the list. The selected class then becomes the current class, and the information in the Class View window changes to reflect this. The Cancel button closes the chooser window without changing the current class.

Figure 7-7. List of Classes Shown


Queries Menu

Figure 7-8. Queries Menu


The Queries menu contains a set of predefined searches for information about the current class, as shown in Figure 7-8. The Class View window outlines display the results of each query by highlighting classes or members. If the Show in Static Analyzer toggle is set to yes, detailed results of the query appear in the WorkShop Static Analyzer window from which you launched the C++ Browser (refer to “Show in Static Analyzer Toggle”). Descriptions of the current query and the magnitude of the results of the query are shown in the message area between the current class field and the outline lists. The selections are:

“What Is Declared” 


displays all methods declared by the current class.

“What Is Defined”  


displays all members defined by the current class.

“What Is Overridden By” 


displays all inherited methods that the current class overrides.

“What Instantiates” 


displays classes that instantiate the current class by invoking its constructors or by using its new methods.

“What Destroys” 


displays classes that destroy the current class by invoking its destructors or by using its delete methods

Figure 7-9. “What Uses” Submenu of Queries Menu


”What Uses” submenu (see Figure 7-9) 


queries which classes use the current class in these contexts:

  • “To Contain” displays classes that use the current class as either an embedded or linked component

  • “As Friend” displays classes that use the current class as a friend class.

  • “Methods” displays classes that use the methods defined by the current class.

  • “Data Members” displays classes that use (by modifying, reading, or taking the address) data members defined by the current class.

“What Is Instantiated” 


displays classes that the current class instantiates by invoking its constructors.

“What Is Destroyed” 


displays classes that the current class destroys by invoking its destructors.

Figure 7-10. “What Is Used” Submenu of Queries Menu


“What Is Used” submenu (see Figure 7-10) 


queries which classes are used by the current class in these contexts:

  • “To Contain” highlights classes that the current class uses either as embedded or linked components.

  • “As Friend” highlights classes that the current class uses as friend classes.

  • “By Methods” highlights classes whose methods are used by the current class.

  • “By Data Access” highlights classes whose data members are assigned, read, or have their address taken by the current class.

Additional queries on classes, data members and methods are accessible from pop-up menus described in “Member List” and “Related Class List”.

Preference Menu

Figure 7-11. Preference Menu


The Preference menu allows you to control how the class information is displayed in the window (see Figure 7-11). The selections are:

“Member Display” submenu (see Figure 7-12) 


allows you to control how the class members are displayed. There are three choices:

  • “Declaration Order” displays the members in order of their declaration.

  • “End To End Sort” performs an end-to-end sort of the member display strings and displays the result.

  • “Name Sort” performs a sort based on the name of the members and displays the result

Figure 7-12. “Member Display” Submenu of Preference Menu


“Align Names” 

aligns the member names in the display. A radio button indicates if this feature is enabled or disabled.

“Align Arglists” 

aligns the member function argument lists in the display. A radio button indicates if this feature is enabled or disabled

Figure 7-13. “Relation Display” Submenu of Preference Menu


“Relation Display”submenu (see Figure 7-13) 


allows you to control how the class relations are displayed. There are two choices:

  • “Declaration Order” displays the related classes in order of their declaration or the detection of their relation.

  • “End To End Sort”displays a sorted list of related classes.

Help Menu

Figure 7-14. Help Menu


The Help menu contains commands that allow you to access online information and documentation for the C++ Browser, as shown in Figure 7-14. It is part of the Static Analyzer help system. See Chapter 2, “Using Online Help,” in the CASEVision Environment Guide for more detailed information on how to use the C++ Browser help features.

“On Version” 

opens a window containing version number information for the Static Analyzer.

“On Window” 

invokes the CASEVision Help Viewer, which displays a descriptive overview of the current window or view and its graphical user interface.

“On Context” 

invokes context-sensitive help. When you select the “On Context” command, the normal mouse cursor (an arrow) is replaced with a question mark. When you click on graphical features of the application with the left mouse or position the cursor over the feature and press the <F1> key, the Help Viewer displays information on that context.

“Index...” 

invokes the Help Viewer, which displays the list of available help topics. You can browse alphabetically, hierarchically, or graphically.

Current Class Field

Figure 7-15. Current Class Field


The Current Class text field is directly below the menu bar (see Figure 7-15). It displays the name of the currently selected class in the Class View window. You can type into this field to change the current class.

Type a complete class name into the text field and then press the <Enter> key to make the change effective. If you type a partial string and then press the <space bar>, the browser attempts to complete the class name with a class from the fileset. It gives a beep if it finds more than one matching class name. If a match is made, press the <Enter> key to make the change effective.

If you type a question mark (?) into the Current Class field, a class chooser dialog window (List of Classes) opens. You can select a new class by left-clicking on a class name in the chooser window's scrolling list, or click once with the left mouse button and then click on the OK or Apply buttons. Clicking Apply leaves the chooser window open; other combinations close the chooser window.

Show in Static Analyzer Toggle

Figure 7-16. Show in Static Analyzer Toggle


The Show in Static Analyzer toggle is directly to the right of the Current Class field (see Figure 7-16). When the toggle is set (highlighted and labeled Yes), the results of all queries are displayed in the WorkShop Static Analyzer window from which the C++ Browser was launched, providing detailed source information not listed in the Class View window. If no results are found, and the Static Analyzer window is open, it comes to the front with an error message. Refer to the CASEVision/WorkShop User's Guide for more information on the Static Analyzer.

Last Query Button

Figure 7-17. Last Query Button


The Last Query button is to the far right, directly beneath the Help menu (see Figure 7-17). Clicking on this button displays the results of the most recent query in the WorkShop Static Analyzer window from which the C++ Browser was launched.

Class View Message Area

The Class View message area is located directly below the Current Class field (see Figure 7-18). This area displays the most recent query as an English sentence, listing both the query question and the name of the data member, method, or class that is the object of the query. The end of the line displays query results, such as how many members and classes are involved.

Class View Outline Lists

The lower two-thirds of the Class View window contains two side-by-side lists that contain information about the currently selected class in outline form (see Figure 7-18).

Figure 7-18. Class View Message Area and Outline Lists


  • The lefthand, or member list, provides a detailed view of the members of the current class.

  • The righthand, or related class list, displays the relationships of other classes and of friend functions to the current class.

The organization of each of these lists is described in “Member List” and “Related Class List”. This section describes features common to both lists. You can change the widths of the lists by moving the sash or central divider.

Outline Icons

Figure 7-19. Expanded List, Downward Pointing Icon


The lists of members and class are organized in an outline format. By clicking on the outline icon to the left of a heading, you can collapse or expand the list under that category. The direction in which the outline icon points indicates if the heading is expanded or collapsed; downward-pointing outline icon indicates that the list is expanded (see Figure 7-19), while a right-pointing icon indicates that the category is collapsed (see Figure 7-20).

Figure 7-20. Collapsed List, Right-Pointing Icon


To collapse an outline list, click on the heading's downward-pointing outline icon. Class View hides the entries for that heading, and the icon toggles to become a right-pointing arrow, as shown in Figure 7-21.

Figure 7-21. Outline Lists and Icons


To expand a list of members or classes under a particular heading, click on the heading's right-pointing icon. Class View displays the entries for that heading, and the icon toggles to become a downward-pointing arrow.

Figure 7-22. Query Result in List, Highlighted Icon


A highlighted right-pointing outline icon indicates that one or more of the collapsed entries matches the most recent query (see Figure 7-22). Click on the outline icon to display the entry.

Annotated Scroll Bars and Highlighted Entries

Figure 7-23. Annotated Scroll Bars


Both outline lists make use of annotated scroll bars as a means of locating highlighted list entries. See Figure 7-23. When you make a query on an entry in the member or related class list, all members or classes that satisfy the query are highlighted in their respective lists; if that entry is collapsed, the corresponding outline icon of the nearest exposed heading that contains the entry is highlighted instead. The annotated scroll bars show where highlighted entries occur in the scrolling list by displaying ticks in the highlight color at the proper location in the scroll bar. When the thumb of the scroll bar overlaps a given tick, the corresponding entry is visible in the list window.

Member List

The Class View member list contains information on types, data members, methods, and virtual methods included in the current class.

Double-clicking on any member in the member list opens a Source View window for that member's code with the member's declaration highlighted. See Figure 7-24.

Figure 7-24. Source View of Class Data Member


Member List Structure

The member list sorts the members of the current class recursively into three nested lists according to the access specification (public, protected, private) of each member. Within each of the three resulting lists, the members are sorted once again by scope into two sublists (instance and static). Finally, within each of these sublists, members are displayed by member category type in this order: type members, data members, methods (member functions), and virtual methods.

Here is a schematic of the outline format for each nested list:

Access (Public, Protected, or Private)
Scope (Instance or Static)
Types
Data
Methods
Virtual Methods

For a discussion of these concepts, refer to “C++ Class Structure and the Current Class”. The list organization is customizable. For more information, refer to “Customizing the C++ Browser”.

Member List Query Menus

This section details each of the pop-up query menus available from the member list display. To execute a query from one of these menus, select the member entry you wish to query on by left-clicking on it. Then, click and hold down the right mouse button anywhere in the member list display to open the corresponding query menu. By choosing the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, and is thus always visible.

The Queries on Data Members pop-up query menu performs these queries on selected data members:

“What Modifies” 


highlights all methods and classes in which the selected data member is assigned a value.

“What Reads” 

highlights all methods and classes in which the selected data member is read.

“What Accesses” 


highlights all classes where the selected data member is assigned a value, read, or its address is taken.

“What Defines” 


highlights the class that defines the selected data member.

The Queries on Methods pop-up query menu performs these queries on selected methods:

“What Uses” 

highlights all methods and classes that use the currently selected method.

“What Is Used” submenu 


contains these menu items:

  • “All (method and data access)” highlights all data members, methods, and classes the currently selected method uses.

  • “Method Calls” highlights all methods called by the currently selected method.

  • “Data Access” highlights all data members that have been assigned, read, or had their address taken by the currently selected method.

  • “Data Modification” highlights all data members assigned by the currently selected method.

  • “Data Read” highlights all data members read by the currently selected method.

“Call Graph” submenu 


contains these menu items:

  • “Add” adds the currently selected method and its calling structure to the Call Graph window, if one is open. If not, “Add” opens a Call Graph window before adding the method.

  • “Replace” replaces all methods in the display with the selected method and its calling structure in the Call Graph window.

  • “Remove” removes the currently selected method and its calling structure from the Call Graph window.

“What Declares” 


highlights the class that declares the currently selected method.

“What Currently Defines” 


highlights the class that provides the current definition for the method.

“What Else Defines” 


highlighs all classes that define the currently selected method.

“What Overloads” 


highlights all methods and classes that overload the currently selected method.

Related Class List

The Class View window lists the current class and its related classes in the related class list. Within this list, the current class is displayed as follows:

<- This

This class refers to the class in the Current Class text field.

Double-clicking on any class listed in the related class list makes it the new current class. Double-clicking on a friend function brings up a Source view window highlighting the function's definition.

Related Class List Structure

The related class list display is composed of seven sublists (not all of which may be in use for a given class):

  • BASE CLASSES contains the current class and its ancestors, listed hierarchically.

  • DERIVED CLASSES contains descendants of the current class, listed hierarchically.

  • USES contains classes that the current class uses (that is, instantiates, destroys, interacts with, or contains).

  • USED BY contains classes that use the current class.

  • FRIEND FUNCTIONS contains global functions declared as friends by the current class.

  • FRIENDS contains classes that are declared as friends by the current class.

  • FRIEND OF contains classes that declare the current class as a friend.

The Base Classes sublist shows the ancestors of the current class, if any. Each indented class is an ancestor of the class listed above it. The Base Classes sublist indicates a multiple inheritance relationship by indenting the two or more parent classes to the same level. If a given class has ancestors, it is accompanied by an outline icon, which works in a similar manner to the outline icons in the member list. Each ancestor name is followed by its inheritance access type (public, protected or private) listed in parentheses.

This schematic gives an example of a possible Base Classes sublist:

BASE CLASSES
<-This
first_parent_of_This (access type)
parent_of_first_parent_class (access type)
second_parent_of_This (access type)
parent_of_second_parent_class (access type)

The Derived Classes sublist shows the descendants of the current class, if any. Each indented class is a descendant of the class listed above it. If a given class has descendants, it is accompanied by an outline icon, which also works in a similar manner to the outline icons in the base classes sublist and member list. (See Figure 7-25 for an example.)

This schematic gives an example of a possible Derived Classes sublist:

DERIVED CLASSES
first_child_of_This
child_of_first_child_class		
second_child_of_This
child_of_second_child_class

Figure 7-25. Class View Derived Classes List


Related Class List Query Menus

This section details each of the pop-up query menus available from the related class list display. To execute a query from one of these menus, select the name of the class you wish to query by clicking on it with the left mouse button. Then, click and hold down the right mouse button anywhere in the related class list display to open the corresponding query menu. By choosing the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, and is thus always visible.

Most of the related class query menus have two generic commands (shown in Figure 7-26) that affect the selected item:

“Show Source” 

opens a Source View window on a file containing the declaration of the selected item. The first line of the declaration is highlighted in the source.

“New Class View” 


opens a new Class View window displaying the selected class.

These two items are omitted from the lists below.

Figure 7-26. Queries on Current Class Pop-U Menu


The Queries on Current Class pop-up query menu (see Figure 7-26) contains items identical with those in the Queries menu in the Class View menu bar. It also contains the two generic commands described previously.

The Queries on Base Class pop-up query menu, under the heading BASE CLASSES, performs these queries on selected classes:

“What Is Declared” 


highlights all methods declared by the selected base class.

“What Is Defined” 


highlights all members defined by the selected base class.

“What Is Overridden” 


highlights all methods belonging to the selected base class that are overridden by the current class.

Figure 7-27. Queries on Derived Class Pop-Up Menu


Queries on Derived Class pop-up menu, under the heading DERIVED CLASSES (see Figure 7-27), allows you to perform functions on selected classes:

“What Is Used” submenu 


contains these queries:

  • “by Accessing Any Member” highlights all members (of the current class) that the selected derived class uses.

  • “by Calling Methods” highlights all methods (of the current class) that the selected derived class uses.

  • “by Accessing Data Members” highlights all data members (of the current class) that the selected derived class modifies, reads, or takes the address of.

  • “by Modifying Data Members” highlights all data members (of the current class) to which the selected derived class assigns a value.

  • “by Reading Data Members” highlights all data members (of the current class) from which the selected derived class reads a value.

“What Is Overridden” 


highlights all members of the current class that are overridden by the selected derived class.

“What Is Overloaded” 


highlights all members of the current class that are overloaded by the selected derived class.

Figure 7-28. Queries on Used Pop-Up Menu


The Queries on Used pop-up menu, under the heading USES (see Figure 7-28), allow you to perform these functions on selected classes:

“What Uses” submenu 


contains these queries:

  • “by Accessing Any Member” highlights all members (of the current class) that use the selected class.

  • “by Calling Methods” highlights all methods (of the current class) that use the methods of the selected class.

  • “by Accessing Data” highlights all data members (of the current class) that modify, read, or take the address of data members of the selected class.

  • “by Modifying Data” highlights all data members (of the current class) that assign a value to data members of the selected class.

  • “by Reading Data” highlights all data members (of the current class) that read a value from data members of the selected class.

“What Instantiates” 


highlights all members of the current class that instantiate the selected class.

“What Destroys”  


highlights all members of the current class that destroy the selected class

.

Figure 7-29. Queries on Users Pop-Up Menu


The Queries on Users pop-up query menu, under the heading USED BY (see Figure 7-29), performs these queries on selected classes:

“What Is Used” submenu 


contains these queries:

  • “by Accessing Any Member” highlights all members (of the current class) that the selected class uses.

  • “by Calling Methods” highlights all methods (of the current class) that the selected class uses.

  • “by Accessing Data” highlights all data members (of the current class) that the selected class reads, modifies, or takes the address of.

  • “by Modifying Data” highlights all data members (of the current class) to which the selected class assigns a value.

  • “by Reading Data” highlights all data members (of the current class) from which the selected class reads a value.

“What Instantiates” 


finds all members of the selected class that instantiate the current class and displays them in the Workshop Static Analyzer window. To see the results of this query, you must have the Show in Static Analyzer toggle set, or you must click on the Last Query button after making the query.

“What Destroys” 


finds all members of the selected class that destroy the current class and displays them in the Workshop Static Analyzer window. To see the results of this query, you must have the Show in Static Analyzer toggle set, or you must click on the Last Query button after making the query.

The Queries on Friend Function pop-up query menu is listed in the related class list for the sake of convenience, under the heading FRIEND FUNCTIONS. Double-clicking a friend function opens a Source View window highlighting the first line of the function definition. This menu performs the query described below on the selected friend function.

“What It Uses” 

highlights all members of the current class that the selected friend function uses.

The Queries on Friend Class pop-up query menu, under the heading FRIENDS, performs the query described below on a selected class.

“What Is Used” 


highlights all members of the current class that the selected friend class uses.

The Queries on Friend Of pop-up query menu, under the heading FRIEND OF, performs the query describe below on a selected class.

“What Uses” 

highlights all members of the current class that use the friend class.

Keyboard Accelerators

To issue Class View commands directly from the keyboard, use the keyboard accelerators in Table 7-1. The accelerators are listed in alphabetical order.

Table 7-1. Keyboard Accelerators for Class View

Command

Ctrl + key

Change to previous class

P

Exit C++ Browser

X

Highlight what is declared by the current class

L

Highlight what is defined by the current class

E

Highlight what is overridden by the current class

R

Open another Class View

V

View Call Graph

A

View Containment Class Graph

O

View Friend Class Graph

F

View Inheritance Class Graph

I

View Interaction Class Graph

T

View list of classes

U

View list of classes shown previously

H


Class Graph and Call Graph Displays

You invoke the Class Graph and Call Graph windows from the Views menu of the Class View window. These windows show graphical views of the current fileset. As their names suggest, a Class Graph displays class relationships, and a Call Graph displays methods and their calling relationships. However, the displays and controls have the same features.

Figure 7-30 shows the bounce fileset class hierarchy. The Class Graph Context View shows an overview of the selected class with respect to the fileset. This section describes in detail how to view classes in a Class or Call Graph window.

Figure 7-30. Class Graph with Context View—Bounce Hierarchy


Class and Call Graph Main Display

The Class and Call Graph main display presents a graphical view of classes (or class nodes) and methods (or method nodes) and their relations. These nodes can be selected, hidden, collapsed, expanded, and moved. Double-clicking nodes are documented under separate headings for each kind of window.

Selecting Nodes

There are several ways to select nodes:

  • To select a single node, click on it with the left mouse button. It becomes highlighted in red.

  • To select a node and all of its descendant nodes, hold down the <Shift> key while clicking on the desired node.

  • To select an arbitrary group of nodes, hold down the left mouse button in an empty area of the display, and then drag it. A box is drawn; move the mouse so that all nodes you want to select are inside the box, then let go of the mouse button.

Node Pop-Up Menus

Two pop-up menus in the main display manipulate nodes: the Class or Method Node pop-up menu, and the Selected Node pop-up menu.

The Class or Method Node Pop-Up Menu appears if you hold down the right mouse button over a particular node. The node's name appears as the menu title. The node does not need to be selected for the menu commands to apply. It contains these commands:

  • “Hide Node” hides the named node and leaves its descendants visible and disconnected from the rest of the graph.

“Collapse Subgraph” hides the named node and its descendants .

Figure 7-31. Hidden Children


  • “Show Immediate Children” adds any non-visible children of the named node to the graph. If a node has hidden children, it contains an arrow within the node pointing to the right (see Figure 7-31).

  • “Show Parents” adds any hidden parents of the named node to the graph.

Any menu items that are not applicable for a given node are grayed out when the menu is opened.

The Selected Nodes pop-up Menu appears if you hold down the right mouse button over an empty portion of the main display. The commands apply to any selected nodes.

  • “Hide Selected Nodes” hides the selected nodes, and leaves their descendants visible and disconnected from the rest of the graph.

  • “Collapse Selected Nodes” hides the selected nodes and their descendants.

  • “Expand Selected Nodes” adds all non-visible descendants of the selected nodes to the graph.

Moving Nodes

You can move any single node (selected or not) by holding the middle mouse button down over the desired node and dragging to the new desired position. You can move a group of nodes by first selecting them, then holding down the middle mouse button over any of the selected nodes and dragging to the new position.

Class and Call Graph Display Controls

The Class or Call Graph main display can be manipulated with the controls found at the bottom of the Class or Call Graph window. Refer to Figure 7-30.

Zoom Option Menu and Zoom Buttons

The Zoom option menu and Zoom buttons let you choose the size of the class nodes in the Class or Call Graph display. You can choose one of the items from the option menu, or click on either of the two buttons to the right of the menu to zoom in or out on the graph.

Overview Button

Clicking on the Overview button opens the Context View window for the Class or Call Graph display. As you move the rectangular pane over a condensed, schematic version of the graph displayed within the Class or Call Graph window, the display scrolls accordingly.

For example, Figure 7-32 shows the Call Context View window opened from a Call Graph. The area under the rectangular viewport is displayed in the Call Graph window. In a Class Graph Context View, the currently selected class node is highlighted in a different color from that of the other class nodes.

Figure 7-32. Call Graph Context Viewport of Call Graph Window


Multiple Arcs Button

Clicking on the Multiple Arcs button toggles the Class or Call Graph display between showing a single arrow for multiple instances of a relationship between two nodes, and showing a separate arrow for each instance.

Align Button

Clicking on the Align button tidies the nodes of the currently displayed graph, snapping them into an orderly configuration.

Rotate Button

Clicking on the Rotate button causes the graph displayed in the Class or Call Graph window to branch downwards from the top of the display, rather than from left to right, which is the default. Clicking on the button a second time returns the display to the default configuration.

Class Graph Window

The Class Graph window is invoked from the Views menu of the Class View window. It displays a graphical view of classes in the current fileset and their relationships. For details about the display, refer to “Class Graph and Call Graph Displays”. This section discusses the menu bar, keyboard accelerators, double-clicking, and the relationship option menu.

Class Graph Menu Bar

The Class Graph window's menu bar contains the three menus described in this section. By choosing the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, and is thus always visible.

Admin Menu

The Class Graph Admin menu contains two commands:

“Save Graph” 

allows you to save the graph to a file. It brings up a file selection dialog. When you select your file and click on “OK,” it saves the graph as a PostScript® file with the name specified in “Selection.”(See Figure 7-33.)

“Close” 

closes the Class Graph window when selected.

Figure 7-33. “Save Graph” Submenu of Admin Menu


Views Menu

The Class Graph Views menu commands control which classes included in the current fileset are displayed in the Class Graph window. The choices are describe below.

“Show All” 

displays all classes included in the fileset as nodes, and their relations as arcs, as chosen from the relationship option menu (see Figure 7-30).

“Show All Related” 


displays only those classes included in the chain of relations, which includes the current class.

“Show Butterfly” 


displays only those classes that are the immediate relatives (for example, parents and children for an inheritance relation of the current class).

Help Menu

The Help menu contains commands that allow you to access online information about the C++ Browser. For more information on the help features of the C++ Browser, refer to “Help Menu”, and to Chapter 2, “Using On-line Help,” in the CASEVision Environment Guide.

Double-Clicking

The current class that is displayed in the Class View from which the Class Graph window was launched is highlighted in the Class Graph window. Double-clicking with the left mouse on any class node in the Class Graph window makes that class the new current class in both the Class View and Class Graph windows.

Class Graph Relationship Option Menu

The relationship option menu lets you switch between viewing the different kinds of class relationships in a Class Graph window. The different graphs that you can display through the the option menu are listed below.

  • “Inheritance”

  • “Containment”

  • “Interaction”

  • “Friends”

Refer to “Views Menu” for descriptions of these menu commands.

Keyboard Accelerators

To issue Class Graph commands directly from the keyboard, use the accelerators in Table 7-2. The accelerators are listed alphabetically by command.

Table 7-2. Keyboard Accelerators for Class Graph

Command

Ctrl + key

Show all

A

Show all related

R

Show butterfly

B


Call Graph Window

The Call Graph window is invoked from the Views menu of the Class View window or from the Queries on Methods pop-up menu for a selected method of the current class. It displays a graphical view of methods of the current class, as shown in Figure 7-34. For details about the display that are the same in the Class Graph window, see “Class Graph and Call Graph Displays”.

Figure 7-34. Working With the Call Graph Display


You add, replace, or remove methods by using the Queries on Methods pop-up menu in the member list of the Class View window. Refer to the Call Graph submenu description in “Member List Query Menus”. Note that when you select a node in the display, a message area opens below the menu bar, showing the method with its argument list.

In a Call Graph window, double-clicking on any method node opens a Source View window on the code defining the method. The definition is highlighted in the source.

Call Graph Menu Bar

The Call Graph window's menu bar contains the two menus described in this section. By choosing the dashed line (the first item in each of the menus), you can “tear off” the menu from the menu bar, so that it is displayed in its own window, and is thus always visible.

Admin Menu

The Call Graph window's Admin menu contains the toggle and three commands described below.

“Show Arglist” toggle 


includes the argument list in the display of each method as shown in Figure 7-35. Clicking the toggle button turns it on. It is highlighted until clicked again, turning it off. Toggling “Show Arglist” shows all hidden nodes.

“Clear” 

removes all methods from the Call Graph window.

“Save Graph” 

allows you to save the graph to a file. It brings up a file selection dialog. When you select your file, it saves the graph to a postscript file. See Figure 7-33 for an example.

“Close” 

closes the Call Graph window.

Figure 7-35. Call Graph With Show Arglist On


Help Menu

The Help menu contains commands that allow you to access online information about the C++ Browser. For more information on the help features of the C++ Browser, refer to “Help Menu”, and to Chapter 2, “Using On-line Help,” in the CASEVision Environment Guide.

Customizing the C++ Browser

The C++ Browser lets you customize your display and the way you work with reference pages (man pages). These formats are implemented as X application resources that you can redefine in your local .Xdefaults file. After editing it, run xrdb .Xdefaults and then reopen the Static Analyzer.

Customizing the Class View Lists

This section shows you how to customize the outline formats of Class View lists by applying your own keyword headers and rearranging the features of each list.

Member List Resource

The layout of the Class View member list is controlled by this resource:

Cvstatic*memberOrder

The general format of this resource is as follows:

Level-1-keyword: HEADING [keyword], HEADING [keyword],..; Level-2-keyword: HEADING [keyword], HEADING [keyword],...; Level-3-keyword: HEADING [keyword], HEADING [keyword],...;

The three level keywords are Protection, Scope, and Member. The order in which these are used determines the level of nesting in the outline list used for protection, scope, and member headings, respectively.

Headings may consist of any string you choose to describe the heading category. The headings listed with the level-1 keyword become top-level headings in the outline list, the level-2 headings appear indented under each of the level-1 headings, and the level-3 headings appear indented beneath each of the level-2 headings.

Each heading in a level has an associated keyword that determines the sort of items that appear under the heading. The allowable keywords are as follows for each associated level keyword:

Protection: 

[public], [protected], [private]

Scope: 

[instance], [static]

Member: 

[type], [data], [method], [virtualmethod]

It is also possible to combine the types associated with two or more keywords under one heading by using the construction for any given heading:

HEADING [keyword1+keyword2+...]

You can also control whether a heading is expanded or collapsed when the browser starts up. Placing an asterisk (*) at the end of the heading string causes that heading to be collapsed by default:

HEADING* [keyword]

The default assignment for the outline resource of the member list can be found in /usr/lib/X11/app-defaults/Cvstatic. The contents of the file appear below:

Cvstatic*memberOrder:	 Protection: PUBLIC [public], PROTECTED* [protected], PRIVATE* [private]; Scope: INSTANCE [instance], STATIC [static]; Member: TYPE* [type], DATA [data], METHODS [method], VIRTUAL_METHODS [virtualmethod];


Note: The sample above is a single line.

You can override this definition by placing your own definition in your local .Xdefaults file. For example, to make the display look like the sample in Figure 7-36, add this line:

Cvstatic*memberOrder: Member: IS (Type) [type], Data Members--------------------- [data], Methods----------------------------- [method], Virtual Methods-------------------- [virtualmethod]; Scope: Non-Static [instance], Static [static]; Protection: Private [private], Protected [protected], Public [public];

Related Class List Resource

The layout of the Class View related class list is controlled by this resource:

Cvstatic*relationOrder

The construction of this resource is similar to that of the member list, but simpler:

HEADING [keyword], HEADING [keyword],...

The headings and keywords work as described for the member list, but there is no concept of level keywords in the related class list.

The allowable keywords for the related class list are as follows:

[base], [derived], [uses], [usedby], [friendfunction], [friend], [friendof]


Note: In the related class list, headings cannot contain multiple keywords, as they can in the member list.

As in the member list, you can control whether a heading in the related class list is expanded or collapsed when the browser starts up. Placing an asterisk (*) at the end of the heading string causes that heading to be collapsed by default:

HEADING* [keyword]

The default assignment for the related class list outline resource can be found in /usr/lib/X11/app-defaults/Cvstatic, and is listed below for your convenience:

Cvstatic*relationOrder: BASE CLASSES [base], DERIVED CLASSES [derived], USES [uses], USED BY [usedby], FRIEND FUNCTIONS [friendfunction], FRIENDS [friend], FRIEND OF [friendof]

You can override this definition by placing your own definition in your local .Xdefaults file. For example, for the display shown in Figure 7-36, try this:

Cvstatic*relationOrder: Parent Classes [base], Child Classes [derived], Used Classes [uses], User Classes [usedby], Friend Functions [friendfunction], Friend Classes [friend], Friend Of [friendof]

Other Class View List Resources

XWindows resources listed in this section, found in /usr/lib/X11/app-defaults/Cvstatic, can be modified in your local .Xdefaults file. The default values are listed with each resource. You can set any true value to false.

Cvstatic*completeClassName: true 


enables ClassName completion; by typing a space in the current class field, you complete a class name from the list of classes in the fileset (if set to true, as it is by default).

Cvstatic*showMessageArea: true 


enables the message area in the Class View window (if set to true, as it is by default).

Cvstatic*scream: true 


enables warning beeps when there are 0 results for a query, or when a class name has more than one completion in the current class field (if set to true, as it is by default).

Cvstatic*indentationWidth: 15 


sets the indentation in the outline lists in pixels. Figure 7-36 shows the making the following change to the resource:

Cvstatic*indentationWidth: 10

Cvstatic*nameAlign: true 


aligns names of the members under the same parent so that the type declarations and member (variable and function) names form left-justified columns (if set to true, as it is by default).

Cvstatic*arglistAlign: true 


aligns the argument lists of member functions under the same parent so they form a left-justified column (if set to true, as it is by default).

Cvstatic*sort: true  


sorts items in the outline lists based on the value of the entire string denoting an item (if set to true, as it is by default). For example, given two members, void f and int k, the C++ Browser lists int k before void f in the list.

Cvstatic*nameSort: true 


sorts items in the outline lists based on the string value of the name of a member (if set to true, as it is by default). For example, void f would be listed before int k).

Using both of the previous resources in conjunction sorts first by type and then by name, as shown in Table 7-3.

Table 7-3. Sort Resources for Outline Lists

sort

name

Sort effect

false

false

Members are in declaration order

false

true

Members are sorted based on the name and not on type or return type. This behavior is shown in Figure 7-36.

true

false

Members are sorted based on the their return type or type. Within the same return type, members appear in declaration order.

true

true

Members are sorted both on their type or return type and their name. This is the default behavior.

Figure 7-36 shows the Class View display using the sample resources set in .Xdefaults.

Figure 7-36. Customized Class View Display


Customizing Reference Page Generation

The resources in this section are associated with the Man Pages for Classes window, available from the Class View Admin menu item “Generate Man Pages.”

Cvstatic*manPageDirPath: <default manpage directory path>  


The default is the current directory (.). To place generated reference pages in the windTunnel directory (that you have created) use this:

Cvstatic*manPageDirPath: ./manpage/windTunnel

Cvstatic*manPageSuffix: .<suffix>  


The default <suffix> is 3. The name of a reference page is <class_name>.3. To change the suffix to 4, use this:

Cvstatic*manPageSuffix: .4

Cvstatic*manPageViewCommand: <commands> 


Pressing the View button in the Man Pages for Classes window executes the command specified by this resource. The argument given is the set of reference pages for the classes that are selected. By default, View displays the most recently generated reference page in a read-only window. The default commands are:

Cvstatic*manPageViewCommand: winterm -H -c man -d

Cvstatic*manPageCopyRightMessage: <string>  


The default string is “Copyright 1994 by Silicon Graphics.” A customized example is:

Cvstatic*manPageCopyRightMessage: Copyright 1994 by Fred Smythe