server.htm |
Understand for C++ listens for requests from other programs. The command line version of the program "understand_c" is used to send requests to the Understand for C++ server.
A client request may be to tell the Info Browser and all synchronized view windows to show information about an particular entityname. Or a request may be to show a particular view of a specific class or file. Or to configure or analyze a project, perform a hypergrep search, or to find a class.
The understand_c program accepts commands in the following forms:
Perform some action on an entity using the current Understand session:
understand_c -n[ame] entityname -file filename [-line linePerform some action on an entity specifying the Understand project to use:
understand_c [-db database] [-new | -existing] -n[ame] entityname -file filename [-line line -col column] actionCommandPerform some action on a file entity:
understand_c [-db database] [-new | -existing] -efile entity_filename actionCommandOpen any file (not project-dependent):
understand_c -openfile filename
When launching understand_c commands, the existing Understand for C++ window can be used or a new Understand for C++ window can be launched and a new project loaded.
To use the existing Understand for C++ window and current project, omit the -db specifier on the command line. You can also specify -exisitng to override any possible user-customized preferences set in the current project. For example:
understand_c -existing -name myEnt -file file.c -line 37 -ibwill load the Info Browser of the current Understand session with the specified entity.
To launch a new instance of Understand, use the -db specifier. You can also specify -new to override any possible user-customized preferences. For example:
understand_c -db myproj.udc -new -name myEnt -file file.cwill launch a new session of Understand, load the database myproj.udc, and show myEnt in the Info Browser.
To specify the entity to be shown, use the following command specifiers:
If the entity is a project file:
-efile filenameOr, if the entity is not a file:
-name entityname -file filename [-line line -col column]Following is a sample command line to load the Info Browser of an existing Understand session with entity prop_ which is referenced in the file view.cpp at line 377:
understand_c -name "prop_" -file view.cpp -line 377 -ib
You can also load any file into the Source Editor. Specify -openfile and the path to the filename:
understand_c -openfile view.cppwill open view.cpp in the current directory and load it into the Source Editor of the existing Understand session.
Many types of actions can be driven by understand_c.
* -entitymenu - popup the entity menu for the specified entity at the current cursor position.
Base Classes |
Callby |
Declaration |
Declaration File |
Declaration Type |
Derived Classes |
Include |
Includeby |
Invocation |
Parent Declaration |
Return Type |
File |
Source |
Popup the entity menu for class c4_View at the current mouse position:
understand_c -name "c4_View" -file mk4.h -entitymenuEdit the source file where class c4_View is defined.
understand_c -name "c4_View" -file mk4.h -edit_srcLoad the Info Browser with the class entity c4_view:
understand_c -name "c4_View" -file mk4.h -ibShow the graphical invocation view for member function entity c4_View:
understand_c -name "c4_View" -file view.cpp -gv "Invocation"The program understand_c uses different communication methods based on the operating system it runs on.
On Windows 95/NT, Dynamic Data Exchange (DDE) is used.
On Unix and VMS, sockets are used to send information to the server. Since the possibility of conflicting with other programs using the same socket address is present, the server port used may be specified on the Browser Tab of the Options->Preferences menu. .
If a conflict arises, change the Server Port to another number.
Here is a simple example integrating understand_c to be launched from a text editor. In this case the editor is the inexpensive (but very powerful) editor called "TextPad". It is available on the Internet at http://www.textpad.com.
Note that TextPad (and many other editors) offer internal variables that may be passed to external programs.
In this case we are passing $Sel (text currently highlighted) in as the entity name argument, $File as the filename, $Line as the line number, and $Col as the column where the entity can be found. In this example, the right click menu of the entity will be displayed in the current mouse position and whatever selection is then chosen from the right click menu will be loaded into the Understand window.
Now, after Double Clicking or highlighting on any C entity in TextPad, we can choose the Tools->Understand_c popup menu option to activate Understand's right click menu for that entity. The selection from the right click menu will then be displayed in the Understand for C++ window
Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com |