1 / 13

Developing Applications with SIDL

Developing Applications with SIDL. ANL SIDL Team MCS Division, ANL April 2003. Basic Strategy. Add new SIDL Compile SIDL Edit generated code Compile project Commit changes. Adding new SIDL. Only new classes produce implementation files Interfaces produce only IOR and client files

wtuttle
Download Presentation

Developing Applications with SIDL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developing Applicationswith SIDL ANL SIDL Team MCS Division, ANL April 2003

  2. Basic Strategy • Add new SIDL • Compile SIDL • Edit generated code • Compile project • Commit changes

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

  4. Example I package Example { interface Greet { void sayHello(); } class HelloWorld implements-all Greet { static void shoutHello(); } }

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

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

  7. Example II #ifndef included_SIDL_Example_HelloWorld_impl #include "SIDL/Example/HelloWorld_impl/HelloWorld_impl.hh“ #endif // DO-NOT-DELETE splicer.begin(SIDL.Example.HelloWorld.sayHello._includes) #include <iostream> // DO-NOT-DELETE splicer.end(SIDL.Example.HelloWorld.sayHello._includes) void SIDL::Example::HelloWorld_impl::sayHello() throw ( ::SIDL::NullIORException) { // DO-NOT-DELETE splicer.begin(SIDL.Example.HelloWorld.sayHello) std::cout << "Hello World" << std::endl; // DO-NOT-DELETE splicer.end(SIDL.Example.HelloWorld.sayHello) }

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

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

  10. Adding a Driver • Code driver • Compile and link driver • Run driver

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

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

  13. Makefile Driver Example def defineSource(self): import build.fileset url = self.project.getUrl() self.filesets[‘programs’] = build.fileset.RootedFileSet(url, [os.path.join(‘bin’, ‘basicTests’)], mustExist = 0) self.filesets[‘basicTestsSource’] = build.fileset.RootedFileSet(url, [os.path.join(‘driver’, ‘cxx’, ‘basicTests.cc’)] tag = ‘cxx executable basicTests’ self.filesets[‘sidl’].children.append(self.fileset[‘basicTestsSource’]) return def setupBuild(self): self.defineSource() self.sidlTemplate.addServer(‘Python’) return

More Related