Developing Applications with SIDL ANL SIDL Team MCS

  • Slides: 13
Download presentation
Developing Applications with SIDL ANL SIDL Team MCS Division, ANL April 2003

Developing Applications with SIDL ANL SIDL Team MCS Division, ANL April 2003

Basic Strategy n n n Add new SIDL Compile SIDL Edit generated code Compile

Basic Strategy n n n Add new SIDL Compile SIDL Edit generated code Compile project Commit changes

Adding new SIDL n Only new classes produce implementation files n n Interfaces produce

Adding new SIDL n Only new classes produce implementation files n n Interfaces produce only IOR and client files Interfaces/classes outside the current package must be fully qualified

Example I package Example { interface Greet { void say. Hello(); } } class

Example I package Example { interface Greet { void say. Hello(); } } class Hello. World implements-all Greet { static void shout. Hello(); }

Compiling SIDL n The default target handles SIDL. /make. py n There is also

Compiling SIDL n The default target handles SIDL. /make. py n There is also a target with ignores dependencies and only compiles SIDL. /make. py sidl

Editing Generated Code n Implementation files are in the server-<lang>-<file>/<package>/<class>_impl n Impl files contain

Editing Generated Code n Implementation files are in the server-<lang>-<file>/<package>/<class>_impl n Impl files contain splicer blocks n n n Bk edit the file you wish to change Insert code between the markers Bitkeeper is the default n Other RC systems could be used

Example II #ifndef included_SIDL_Example_Hello. World_impl #include "SIDL/Example/Hello. World_impl. hh“ #endif // DO-NOT-DELETE splicer. begin(SIDL.

Example II #ifndef included_SIDL_Example_Hello. World_impl #include "SIDL/Example/Hello. World_impl. hh“ #endif // DO-NOT-DELETE splicer. begin(SIDL. Example. Hello. World. say. Hello. _includes) #include <iostream> // DO-NOT-DELETE splicer. end(SIDL. Example. Hello. World. say. Hello. _includes) void SIDL: : Example: : Hello. World_impl: : say. Hello() throw ( : : SIDL: : Null. IORException) { // DO-NOT-DELETE splicer. begin(SIDL. Example. Hello. World. say. Hello) std: : cout << "Hello World" << std: : endl; // DO-NOT-DELETE splicer. end(SIDL. Example. Hello. World. say. Hello) }

Compiling the Project n n The default target handles compilation There is also a

Compiling the Project n n The default target handles compilation There is also a target that only compiles n SIDL dependencies are also handled. /make. py compile n Also builds all dependencies

Commit the Changes n Changes to Impl files must be committed to Bitkeeper n

Commit the Changes n Changes to Impl files must be committed to Bitkeeper n Use the graphical check-in tool bk citool n Then push to the parent bk push

Adding a Driver n n n Code driver Compile and link driver Run driver

Adding a Driver n n n Code driver Compile and link driver Run driver

Coding a Driver n Use the bindings for the driver language n n Multiple

Coding a Driver n Use the bindings for the driver language n n Multiple source files can be used n n Located in client-<lang> Multiple languages can also be used Please reconsider using Fortran

Building the Driver n n Python is EASY, just make calls Additions to the

Building the Driver n n Python is EASY, just make calls Additions to the makefile n n List of driver source Location of driver executable Put driver source in input files Driver build target. /make. py compile. Programs

Makefile Driver Example define. Source(self): import build. fileset url = self. project. get. Url()

Makefile Driver Example define. Source(self): import build. fileset url = self. project. get. Url() self. filesets[‘programs’] = build. fileset. Rooted. File. Set(url, [os. path. join(‘bin’, ‘basic. Tests’)], must. Exist = 0) self. filesets[‘basic. Tests. Source’] = build. fileset. Rooted. File. Set(url, [os. path. join(‘driver’, ‘cxx’, ‘basic. Tests. cc’)] tag = ‘cxx executable basic. Tests’ self. filesets[‘sidl’]. children. append(self. fileset[‘basic. Tests. Source’]) return def setup. Build(self): self. define. Source() self. sidl. Template. add. Server(‘Python’) return