8.3.1. Viewing data by class with the Class browser window

The Class browser window provides a class-based view of the information in the browser database for the current build target. You can use the Class browser window to view C++ classes, member functions, and data members in the current build target.

Note

You must use the File Mappings configuration panel to map the ARM RealView Compiler to process all C++ source and header files containing classes. By default, header files are mapped to the ARM RealView Compiler.

Opening a Class browser window

To open the Class browser window:

  1. Ensure that the browser is activated. See Enabling browser data production for more information.

  2. Select Class Browser from the View menu. Alternatively, you can:

    • right-click a class name to display the Browser Contextual menu and select Open Browser for classname

    • double-click a class name in a Hierarchy window.

    The CodeWarrior IDE displays a Class browser window (see Figure 8.2).

    Figure 8.2. Class browser window

    Class browser window

The main components of the Class browser window are:

Browser toolbar

The browser toolbar provides access to a number of CodeWarrior IDE commands, including the Go Forward and Go Back buttons, and buttons to open Hierarchy view windows. See Finding declarations, definitions, overrides, and multiple implementations for more information.

Browser Access Filters drop-down menu

Use this drop-down menu to filter the display of member functions and data members. See Filtering members by access type for more information.

Pane zoom box

The pane zoom box enlarges and shrinks panes within the Class browser window.

Resize bar

A resize bar is located between each pair of panes. To resize two panes, drag the resize bar located between them.

Classes pane

The Classes pane lists classes in the browser database for the current build target. See Viewing class and member information for more information.

List button

Click the List button to toggle between an alphabetical list or a hierarchical list in the Classes pane. See Viewing class and member information for more information.

Click this button to switch to a hierarchical list.

Click this button to switch to an alphabetical list.

Class display button

Click the Class display button at the bottom left of the Class browser window to toggle the display of the Classes pane.

Click this button to hide the classes pane.

Click this button to display the classes pane.

Class declaration button

Click the Class declaration button to display the class declaration for the current class in the Source pane. The name of the current class is displayed in the Status area of the Class browser window.

Member Functions pane

The Member Functions pane lists all member functions defined in the selected class. Constructors and destructors are at the top of the list. All other member functions are listed in alphabetical order.

To display inherited member functions select the Show Inherited check box in the toolbar.

The Inherited access icon in the Class browser window darkens to indicate that inherited member functions are currently displayed.

Note

Select a member function in the Member Functions pane in the Class browser window and press the Enter key to open an editor window and view the definition of the selected function.

Data Members pane

The Data Members pane lists all data members defined in the selected class. You can also display inherited data members by enabling the Show Inherited check box in the toolbar.

The Inherited access icon in the Class browser window darkens to indicate that inherited data members are currently displayed.

The entries in the Data Members pane are listed in alphabetical order. If inherited members are displayed, data members are listed by superclass, but alphabetically within each class.

Note

Select a data member in the Data Members pane in the Class browser window and press the Enter key to open an editor window and view the declaration of the selected data member.

Identifier icon

Member functions that are declared static, virtual, or pure virtual are identified with an icon. Table 8.2 describes the icons.

Table 8.2. Browser identifier icons

Icon

Meaning

The member is…

Static

A static member

Virtual

A virtual function that you can override, or an override of an inherited virtual function

Pure virtual

A member function that you must override in a subclass if you want to create instances of that subclass

Source pane

The Source pane displays the source code for the selected item.

Note

To enter function calls or variable names into the code in the source pane, Alt+click an item in the Member Functions pane or the Data Members pane. The item is entered into the Source pane text at the current insertion point.

The text in the Source pane is fully-editable. The path to the file that contains the code on display is shown at the top of the Source pane.

Open File icon

Click this icon to open the file that contains the code displayed in the Source pane in a new editor window.

VCS drop-down menu

The VCS drop-down menu is available if you have a version control system installed.

Note

For more information about the VCS plug-in modules which are available for use with the CodeWarrior IDE, see the Metrowerks web site.

Status area

The status area displays various status messages and other information. For example, when you select a class from the Classes pane, the status area displays the base classes for the selected class.

Viewing class and member information

The Class browser window enables you to locate and view class and member definitions in your source code. To view class and member information:

  1. Open a Class browser window. See Opening a Class browser window for more information.

    The class and member information is displayed in the panes of the Class browser window. The Classes pane see (Figure 8.3) displays a list of classes in the current build target.

    Note

    The Classes pane does not display information about classes or structures that do not have any member functions, base classes, or subclasses. This means that structures and classes that have only fields and data members are not displayed.

    Figure 8.3. Classes pane

    Classes pane
  2. Click the List button at the top right of the classes pane (see Figure 8.2) to select either a hierarchical list or alphabetical list of classes in the classes pane:

    Alphabetical list

    This list type displays an alphabetical list of classes in the current build target.

    Hierarchical list

    This list type displays a hierarchy expansion triangle next to class names that have subclasses (Figure 8.3 shows an example of a hierarchical list):

    • Click an expansion triangle to toggle the display of subclasses.

    • Alt+click an expansion triangle to open all subclasses at all levels. This is called a deep disclosure.

    • Ctrl+click an expansion triangle to open a single level of subclass in a class and all of its siblings at the same level. This is a called a wide disclosure.

    • Ctrl+Alt+click an expansion triangle to perform a wide and deep disclosure.

    Note

    When you select a class in the Classes pane, the multi-class hierarchy window selection scrolls to the newly-selected class if it is not already displayed.

  3. Navigate to the class, member function, or data member you want to view:

    1. Click within a pane to make it the active pane. You can also use the Tab key to navigate through the panes, except for the Source pane.

      Caution

      If the Source pane is active and you press the Tab key, a Tab character is entered into your source code.

    2. Select an item within a pane in any of the following ways:

      • Click an item in any list.

      • Use the arrow keys to navigate through the items in the active pane.

      • Type the name of the item. The item in the active pane that most closely matches the characters you type is selected.

      When you select different items in the panes the Class browser window display changes:

      • When you select a class name, the Member Functions pane and Data Members pane display the members of the selected class. Figure 8.4 shows an example for the class Circle.

      • The source code pane displays the definition or declaration for the selected item. If the selected item is:

        • a class, the pane shows the class declaration

        • a function, the pane shows the function definition

        • a data member, the pane shows the data member declaration.

    Figure 8.4. Member functions, data members, and declaration for class circle

    Member functions, data members, and declaration for class circle

Use the features of the browser to control the display of browser information, navigate to specific sections of code, or open other browser views. For more information on browser functions see:

Filtering members by access type

You can use the Access Filters drop-down menu to filter the display of member functions and data members in the Class browser view. The drop-down menu commands filter the display according to public, private, and protected access types. To filter the display of members:

  1. Open a Class browser window. See Opening a Class browser window for more information.

  2. Select the class you want to display. See Viewing class and member information for more information.

  3. Click on the Access Filters drop-down menu in the Class browser toolbar (Figure 8.5).

    Figure 8.5. Access filters drop-down menu

    Access filters drop-down menu

    The drop-down menu displays a list of access types. A bullet is displayed in the menu next to the access type currently selected.

  4. Select the access type you want from the drop-down menu:

    View as implementor

    Select this option to show members with public, private, and protected access.

    View as subclass

    Select this option to show members with public and protected access.

    View as user

    Select this option to show only members with public access.

    Show public

    Select this option to show only members with public access

    Show protected

    Select this option to show only members with protected access.

    Show private

    Select this option to show only members with private access.

The access icons at the bottom right corner of the Class browser window are dark if the access type is selected, and grayed out if the access type is not selected (Figure 8.6).

Figure 8.6. Browser access filter icons

Browser access filter icons

Opening another view from the Class browser view

There are a number of ways in which you can open a hierarchy or class view from the Class browser window, including:

  • Click the Show hierarchy button to open a single-class or multi-class hierarchy window.

  • Right-click any browser symbol in the window and use the Browser context menu. See Using the Browser context menu for more information.

Saving a default Class browser window

You can save Class browser window configurations to be used as the default for new Class browser windows. You can save the:

  • size and placement of Class browser window

  • size and placement of the Classes, Member Functions, Data Members, and Source code panes within the Class browser window.

To save a default Class browser window:

  1. Set up the Class browser window to your preferences. See Opening a Class browser window for information on resizing controls in the Class browser window.

  2. Select Save Default Window from the Window menu. The current Class browser window is saved and used as a default for all your CodeWarrior IDE projects.

Copyright © 1999-2001, 2005-2007 ARM Limited. All rights reserved.ARM DUI 0065G
Non-Confidential