Files at a glance

Before we present these examples, we should sketch what files are generated or written by the programmer in a typical ORBit application. The load of files generated from the IDL specification may seem very complex at a first glance, and the following table tries to make clearer which files are really important. The first file the programmer must write in an ORBit application, is the IDL file. For a f.idl IDL specification, running


bash $orbit-idl-2 --skeleton-impl f.idl
will produce most of the needed files to start writing the application (you can see it as a framework). They are listed in the following table:

FileUsage
f-stubs.cdo not edit (translation of your IDL)
f-skels.cdo not edit (translation of your IDL)
f-common.cdo not edit (generated from IDL)
f.hdo not edit
f-skelimpl.cadd the code of the server methods

Files remaining to write :

f-client.cwrite the client code
f-server.cwrite the generic code for servant creation

The first three files deal with communication implementation and are automatically generated from your IDL file. The f-skelimpl.c file contains the framework of the servant functions: you should find near the end of the file, function prototypes corresponding to the one you have declared in your IDL. You have to fill in these function with the real code. Of course, you should keep this file only on the server side since it is of no use for the client.

The f-client.c (you can choose another name) is to be written by the programmer. This is where the programmer initializes the ORB and binds the client to the server using the IOR.

The f-server.c (you can choose another name) must also be written but this part is rather generic and is usually copied from an existing application and hardly ever modified during the application developpement. It always deals with the ORB initialization and the POA creation so that servants are spawned to execute the server code defined in f-skelimpl.c .