|
Note that SaveState and RestoreState can be hooked to in two ways: add-ins get the event, but an object wants to get the method so that it can issue an appropriate reply.
For examples of objects and add-ins using the stub generator, see the AuthenticationObject and TrivialMayI objects, respectively.
There are limits to the amount of C++ which the stub generator can handle, however. If you have a type such as UPSet in your interface, you will have to edit the resulting files in order to call new on LPSetLL. The stub generator will generate memory leak warning. Give a name to every parameter in the interface, although I can almost always detect that it's missing and create one for you. If the new class inherits from other Legion classes include the list of class names, beginning with the parent and ending with the new class. Note that multiple inheritance is not supported. No client calls are generated for the object-mandatory interface.
The Legion-CORBA IDL is an OMG IDL compiler. It uses the legion_generate_idl command to parse CORBA input IDL files from a distributed application and generate Legion stub code for the application (Figure 13).
Figure 13: The Legion IDL ![]() |
The stub code is currently written only in C++. The legion_make_idl command compiles the stub code with the client's and server's implementation code and generates an executable Legion client program and Legion server program.
The Legion IDL is an on-going project. It currently supports most IDL language features, such as modules, interfaces, operations, arguments, attributes, etc. It does not currently support the following features:
The Legion IDL is tested for a i386-linux platform, and the generated stub code is tested on i386-linux and Sun Solaris 2.5.1 platforms.
The CORBA IDL files are located in the $LEGION/src/CORBA directory. You may need to compile these files separately. If so, move to the $LEGION/src/CORBA/OMG_IDL directory and type make. The executable legion_generate_idl program will be copied into your $LEGION/bin/$ARCH directory. Usage is as follows:
legion_generate_idl [<flags>]
<input file local path>
(Please see the Reference Manual or the man page for information about the legion_generate_idl flags.)
This command generates Legion stub files for input IDL files. Optional flags allow you to include information about the preprocessor and the back end and to specify whether or not trans code, client stubs, and header files should be created. If you run the command with no flags, Legion will generate client-side and server-side stubs. For example, if apps.idl is your input IDL file name and you run:
Legion will generate the following stubs files.
On the other hand, if you run:
Legion will generate client-side stubs and header files but no .trans file.
You must prepare the implementation code for the client and server. To build server code for the sample input file apps.idl, copy out the interface mapping from apps.mapping.h generated above to a new file called apps.org.h, derive a server class in apps.org.h from the base class generated in apps.mapping.h, then add private variables and methods to the server class.
The apps.client-stubs.new.h and apps.client-stubs.new.c should be compiled with an apps.client.c file, which must include code to implement the client part of the application. The implementation code of server code methods should be in a file called apps.org.c.
You can then use the legion_make_idl command to compile your stub files. Usage is:
legion_make_idl [-notrans] [-noclient]
[-v] [-noreg] [-s <suffix string>]
[-run] [-help] <application name>
(Please see the Reference Manual or the man page for information about the flags.) Continuing our example, if you ran:
And, assuming no compilation errors, the application will then run as:
[Home] [General] [Documentation] [Software] [Testbeds] [Et Cetera] [Map/Search]
|
legion@Virginia.edu
http://legion.virginia.edu/