Babar logo
Workbook HEPIC Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
Unwrap page!
Wkbk. Search
Wkbk. Sitemap
Logging In
Info Resources
Software Infrastructure
CM2 Introduction
Event Store
Modifying Code
Writing and Editing
Framework II
Find Data
Batch Processing
Advanced Infrastructure
New Releases
Main Packages
Event Displays
Contributing Software
Advanced Topics
Make CM2 Ntuples
New Packages
New Packages 2
Persistent Classes
Site Installation
Check this page for HTML 4.01 Transitional compliance with the
W3C Validator
(More checks...)

Workbook for BaBar Offline Users - The xemacs OO-Browser

The xemacs OO-Browser is a source code browser for developers. It allows easy navigation between the header files and implementation files. In addition, it can display the inheritance trees and with simple mouse-clicks, it can edit the corresponding header files.

Be aware that filenames in the following example xemacs OO-Browser windows are for visual demonstration only and are not intended for real work. Displays from xemacs OO-browser may vary slightly depending on the machine you run on and the version of xemacs you use. In spite of these minor differences, you should be able to get a feeling for how xemacs OO-browser works.

Set Up the Environment

Make sure xemacs is available on the machine you are working on. Check this with the command:
     > which xemacs
Choose the directory you want to work in and where you want to analyze data. xemacs OO-Browser will load in files starting from the current directory so begin with a directory with a small number of files (not /BFDIST or /BFROOT directories). In this example, I will go to the FrameExample subdirectory in my checked out test release.
     > cd ~raines/babar/7.8.2/FrameExample

Run the OO-Browser

Start the xemacs OO-Browser program.
     > xemacs oo-browser 
From the "Tools" menu select "OO-Browser" from the drop-down list displayed. A subwindow appears within xemacs OO-Browser with a list of files it found in the current directory.


The subwindow's buffer should prompt you with "Load/Create OO-Browser Environment". For the moment, you do not have an OO-Browser environment so just click "ok" or hit the return key.
The language selector window is displayed asking which language you want to use.


For this example select "C++". Once you've selected a language, the OO-Browser window will reappear and the buffer window should say "Please specify the "OOBR" Environment (Hit RTN to begin)". Respond with a carriage return. This will create files starting with "OOBR" in the current directory. The next time you run OO-Browser, it will use these files to read in the environment for your source so you will not have to rebuild them from scratch.

Now OO-Browser will prompt for system directories and library directories.


A few words about "System Search dir" and "Library search dir" before moving on. A system directory is a directory in which you are developing code. A library directory is more stable and should not change much over time. For this example, the response, when asked for the "System search dir #1" is dot (.) for current directory. Note that xemacs will recursively analyze subdirectories. After specifying the current directory, it prompts for "System search dir #2 (RTN to end)". Enter in another directory you want searched or hit carriage return to indicate you are finished entering directories.

For this example, I will enter "$BFDIST/releases/7.8.2/Framework" for "#2" so that OO-Browser can find the files that belong to the ancestor classes that classes in "FrameExample" inherit from. When prompted for "#3", I will simply press the return key to stop. In principal, you should continue entering directories for each package your package depends on. However, this can take a long time. Just enter the packages that define the classes you know you will want to browse into. If you fail to have OO-Browser search that package, you will get an error message Class 'Foo' referenced but not defined when you attempt to do a browse operation on that class. It is possible to add individual classes by file after an environment build if you really want to browse a class when you get this error.

Next, OO-Browser will prompt you for a series of library directories. You will see the prompt "Library search dir #1 (RTN to end)". Enter in the library directories just like you did for the system search directories. Enter a carriage return to indicate you are done entering libraries. Possible directories to enter here are the Rogue Wave and Objectivity include file directories. However, I have no desire to browse into those classes so I will simply press "enter" for "dir #1" in our example.

OO-Browser prompts if it should build the environment. The response is "y" for yes. It will also ask if it should build the environment as a background process. If you have several hundred classes it may take anywhere from many minutes to hours for OO-Browser to analyze your files so you may consider running in the background if you have many files in your directory. For this example, however, the response is "n" for no.

OO-Browser starts scanning and building the environment. It saves the OO-Browser settings in files named OOBR and OOBR-FTN. These files will be re-used each time you launch xemacs OO-Browser. Once scanning and building have completed a subdivided window will be displayed.


Notice that help is now accessible from this set of windows.

The upper most left window contains all the class names OO-Browser has found in its analysis. Use the left mouse button to place the cursor on a name then type "vf" to edit. The "v" key causes the header file to appear in the bottom window. The "f" lists the "features" -- method and member names, ancestor class, etc. -- in the second upper window with some symbols for constructors, etc. Indentation is used to show the methods coming from which base class. Place the cursor on a method name then type "v" to see the implementation.


To get the result shown in the image above, I did the following:

     Placed the cursor on class "ExampleCompoundCommand" in the top, left list box

     Typed vf

     Placed the cursor on the "inputHandler" method in the second list box

     Typed v

Note that "APPCommand" is the base class of "ExampleCompoundCommand", however "APPCommand" is indented underneath "ExampleCompoundCommand" in the second list box. At first, this may be confusing, but it is how OO-Browser shows that "ExampleCompoundCommand" inherits the following methods listed from its base class.

Many features of OO-Browser can be accessed from the "OO-Browser" menu. Selecting "Class -> Graphical-Descendents" should popup a window that displays a graphical hierarchy of the classes. Select "Environment -> Rebuild" after making a lot of changes.

Emacs commands like "C-s" (control s) for searching, work in every xemacs window displayed. You can perform a search on a class name in the upper most left window, which is the window containing the class names.

General Related Documents:

Back to Editing Code

Charlotte Hee
Marc Verderi, Paul Raines Last edited by: Jenny Williams

Last modification: 13 June 2005
Last significant update: 22 January 1999