1 / 9

Overloaded Methods in Babel

Tammy Dahlgren, Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October 3-4, 2002. Overloaded Methods in Babel. This work was performed under the auspices of the U.S. Department of Energy by the University

gunda
Download Presentation

Overloaded Methods in Babel

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. Tammy Dahlgren, Tom Epperly, Scott Kohn, and Gary KumfertCenter for Applied Scientific ComputingCommon Component Architecture Working GroupOctober 3-4, 2002 Overloaded Methods in Babel This work was performed under the auspices of the U.S. Department of Energy by the University of California, Lawrence Livermore National Laboratory under Contract No. W-7405-Eng-48. UCRL-PRES-150373

  2. Agenda • Background • SIDL Example • Generated Impl Names • Generated Stub Names • More information

  3. What is method overloading? Method overloading is the object-oriented practice of defining more than one method in a class with the same namebut different signatures.

  4. Why is it useful? Method overloading allows convenient reuse of a method name when the underlying implementation varies based on the arguments.

  5. As an example, below is a snippet of SIDL associated with a simulation. class Simulation { void init (in InputDatabase database); void init[FromRestart] (in string dir, in int num, in InputDatabase database); … void write[Restart] (in string filename, in int sequence_ext); void write[Vis] (in string filename, in int sequence); } Right! Short name Name extension Wrong! Simulation.sidl Based upon an exact match of arguments – type(s) and ordering!

  6. Glue code can then be generated for each supported language from the SIDL file. Application SIDL interfacedescription Stubs IORs Skels Overloaded names can appear here Impls

  7. Generated Stub method names used by the caller depend upon language support.

  8. Similarly, Impl method names depend upon language support.

  9. For more information, refer to the documentation and examples. • Babel User’s Guide • Contains an example SIDL file (in section 3.4.4) that is used by the language binding chapters to illustrate how each language calls the methods. • Examples • The regression tests’ overload subdirectory contains code for each of the supported languages.

More Related