Information can be stored in the Interface Repository (IR) but it must be transformed first. The IDL compiler is used to parse the IDL file, transform the information in the IDL source into Interface Repository objects, and serialize the objects to IR databases.
To emit IDL information contained in IDL source files into the IR:
nsdom_ir in the OSS shell. For
example:
export nsdom_ir="nsdom.ir"
nsdom_ir key in the application-specific ORB profile in the configuration database.nsdom_ir key in the default ORB profile in the configuration database.
-ir for update
-IR for replace
For example:
nsdidl -ir | -IR stack.idl
The update option updates existing interface objects in the IR with ones with later version IDs from the IDL source. The replace option replaces the existing interface objects. Both options create new interface objects in the IR if no interface objects with same scoped name exist.
If you specify more than one IR database for nsdom_ir, separate the database names with semicolons. If any of the
IR databases is empty or invalid, an error message is
logged by the IR Emitter and no IDL information is emitted to
the IR.
To generate IR databases, first point
nsdom_ir to one IR database and emit a set of IDL
sources. Then expand nsdom_ir to point to two IR databases
by appending the path of the second database to the first one, and
emit another set of IDL sources. The information on the
second set of IDL sources is emitted to the second IR
database. You can repeat the process as needed.
You can use the showir tool to browse the IR databases.
Set nsdom_ir accordingly as described above and then
run showir to display the IR database contents. showir
has the following options:
$ showir -?
showir [ -i <RepoID> ] [ -s <ScopedName> ] [ -n <Name> ]
<RepoID><ScopedName><Name>showir -i IDL:omg.org/CORBA/orb:1.0 showir -s ::CORBA::orb showir -n orb
Following is a sample IDL source file that contains information that will be emitted to the IR:
$ cat stack.idl
interface Stack
{
const long StackSize = 10;
exception STACK_OVERFLOW{};
exception STACK_UNDERFLOW{};
boolean full( );
boolean empty( );
long top( ) raises(STACK_UNDERFLOW);
long pop( ) raises(STACK_UNDERFLOW);
void push(in long aNumber) raises(STACK_OVERFLOW);
};
$ export nsdom_ir="nsdom.ir"
$ nsdidl -ir stack.idl
$ showir
NSDOM Interface Repository:
NSDOM Interface subrepository: nsdom.ir
Kind : dk_Interface
Id : IDL:Stack:1.0
Name : Stack
Version : 1.0
Scoped : ::Stack
Container: ::
TypeCode: CORBA::tk_objref
ID = IDL : Stack:1.0
Name = Stack
Base Interfaces:
Kind : dk_Constant
Id : IDL:Stack/StackSize:1.0
Name : StackSize
Version : 1.0
Scoped : ::Stack::StackSize
Container: ::Stack
TypeCode: CORBA::tk_long
Any Value = 10
Kind : dk_Exception
Id : IDL:Stack/STACK_OVERFLOW:1.0
Name : STACK_OVERFLOW
Version : 1.0
Scoped : ::Stack::STACK_OVERFLOW
Container: ::Stack
Exception Members:
Kind : dk_Exception
Id : IDL:Stack/STACK_UNDERFLOW:1.0
Name : STACK_UNDERFLOW
Version : 1.0
Scoped : ::Stack::STACK_UNDERFLOW
Container: ::Stack
Exception Members:
Kind : dk_Operation
Id : IDL:Stack/full:1.0
Name : full
Version : 1.0
Scoped : ::Stack::full
Container: ::Stack
Return Type:
TypeCode: CORBA::tk_boolean
Operation Mode: CORBA::OP_NORMAL
Parameters :
Exceptions :
Contexts :
Kind : dk_Operation
Id : IDL:Stack/empty:1.0
Name : empty
Version : 1.0
Scoped : ::Stack::empty
Container: ::Stack
Return Type:
TypeCode: CORBA::tk_boolean
Operation Mode: CORBA::OP_NORMAL
Parameters :
Exceptions :
Contexts :
Kind : dk_Operation
Id : IDL:Stack/top:1.0
Name : top
Version : 1.0
Scoped : ::Stack::top
Container: ::Stack
Return Type:
TypeCode: CORBA::tk_long
Operation Mode: CORBA::OP_NORMAL
Parameters :
Exceptions :
::Stack::STACK_UNDERFLOW
Contexts :
Kind : dk_Operation
Id : IDL:Stack/pop:1.0
Name : pop
Version : 1.0
Scoped : ::Stack::pop
Container: ::Stack
Return Type:
TypeCode: CORBA::tk_long
Operation Mode: CORBA::OP_NORMAL
Parameters :
Exceptions :
::Stack::STACK_UNDERFLOW
Contexts :
Kind : dk_Operation
Id : IDL:Stack/push:1.0
Name : push
Version : 1.0
Scoped : ::Stack::push
Container: ::Stack
Return Type:
TypeCode: CORBA::tk_void
Operation Mode: CORBA::OP_NORMAL
Parameters :
Name: aNumber
Mode: CORBA::PARAM_IN
Type:
TypeCode: CORBA::tk_long
Exceptions :
::Stack::STACK_OVERFLOW
Contexts :