The ir example illustrates the mechanism used to query the Interface
Repository (IR), to traverse the IR and to print its contents.
This program binds to the IRObject, looks up a given interface name
in the IR and prints the names of methods and attributes of the interface
associated with the interface. Particularly, it illustrates the use of
the lookup() and describe_interface() methods.
This program binds to the IR object, queries the IR for its contents (treating
the IR as a container), traverses the container recursively to print its
contents.
IDL file used as an example to load into the IR.
To run the examples, first make sure that the VisiBroker Smart Agent (osagent executable) is running on your network. Then start the Interface Repository server process (irep). A graphical interface will popup from which you can load the file ir.idl into the IR. Alternatively you can start the Interface Repository server process (irep) in the console mode using the command:
prompt> irep -console my_irep_server
(start irep -console my_irep_server on Windows)
Next, load ir.idl into the ir.
irep_prompt> rir.idl // Note: There is no space between the "r" and
// the ir.idl filename
Do not quit from the shell started by the irep process.
Next, run the PrintIDL program.
prompt> vbj PrintIDL CORBA::IRObject (or another interface)
The PrintIDL program binds to the IR, looks up the interface requested
by the user and prints the names of methods and attributes of the interface
stored in the IR associated with it.
Next, run the PrintIR program.
prompt> vbj PrintIR
The PrintIR program binds to the IR, queries the interface repository
for all of its contents, traverses the IR recursively and prints the contents
in an IDL like output. You can match the output against the information
in the IDL file ir.idl