// Updated: June 1999 // This file contains OMG IDL from CORBA Languages - Ada Language Mapping // Interface Mapping Example File barn.idl typedef long measure; interface Feed { attribute measure weight; }; interface Animal { enum State {SLEEPING, AWAKE}; boolean eat(inout Feed bag); // returns true if animal is full attribute State alertness; readonly attribute Animal parent; }; interface Horse : Animal{ void trot(in short distance); }; File chicken.idl: #ifndef CHICKEN #define CHICKEN interface Chicken; #include "egg.idl" interface Chicken { Egg lay(); }; #endif File egg.idl: #ifndef EGG #define EGG interface Egg; #include "chicken.idl" interface Egg { Chicken hatch(); }; #endif interface Asset { ... void op1(); void op2(); ... }; interface Vehicle { ... void op3(); void op4(); ... }; interface Tank : Vehicle, Asset { ... }; struct Example { long member1, member2; boolean member3[4][8]; }; union Example switch (long) { case 1: case 3: long Counter; case 2: boolean Flags [4] [8]; default: long Unknown; }; IDL File: drawing.idl module Fresco { interface DrawingKit { typedef sequence Data8; typedef sequence Data32; }; }; const double Pi = 3.1415926535; const short Line_Buffer_Length = 80; const long Page_Buffer_Length = (Line_Buffer_Length * 60) + 2; const long Legal_Page_Buffer_Length = (80 * 80) + 2; typedef string Name, Street_Address[2]; typedef Name Employee_Name; typedef enum Color {Red, Green, Blue} RGB; interface Base {}; typedef Base Root; #define ex_body {unsigned long minor; completion_status completed;} enum completion_status {COMPLETED_YES, COMPLETED_NO, COMPLETED_MAYBE}; enum exception_type {NO_EXCEPTION, USER_EXCEPTION, SYSTEM_EXCEPTION}; exception access_error { long file_access_code; string access_error_description; } interface stack { typedef long element; exception overflow{long upper_bound;}; exception underflow{}; void push (in element the_element) raises (overflow); void pop (out element the_element) raises (underflow); }; File cultivation.idl: #include "barn.idl" interface Plow { long row(); void attach(in short blade); void harness(in Horse power); };