1 / 14

IDL Interface Definition Language

IDL Interface Definition Language. IDL interface definition. Server. Client. Dynamic Interface. IDL stubs. Static skeletons. Dynamic skeletons. Interface repository. IDL products. Object adapter. Object Request Broker. Main IDL elements. Modules Interfaces Data types Constants

whollis
Télécharger la présentation

IDL Interface Definition Language

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. IDLInterface Definition Language

  2. IDL interface definition Server Client DynamicInterface IDLstubs Staticskeletons Dynamicskeletons Interfacerepository IDL products Object adapter Object Request Broker

  3. Main IDL elements • Modules • Interfaces • Data types • Constants • Attributes • Operations • Exceptions

  4. IDL data types • Basic types • short long float boolean ... • Derived types • using the typedef keyword • Structured types • enum struct union array • Variable types: • dynamic arrays, string • The Any type

  5. Basic types and constants • Integer: [unsigned] shortlong • Reals: floatdouble • 8 bits: charoctetboolean • Generic: any const double Pi = 3.1415926 ; const string Msg = “This is a message” ; const unsignedlong Mask =(1<<5)|(1<<7) ;

  6. Structured types enum CreditCard {Master, Visa, none}; struct PersonRecord { string name ; short age ; } union Customer switch (CreditCard) { case Master: string cardNumber ; ... }

  7. Arrays, sequences, and strings // arrays typedef long longVect [30]; typedef long longArray [2][10]; // sequences typedef sequence <short> shortSeq; typedef sequence <short,20> shortSeq20; // strings typedef string <1024> boundedString;

  8. Module declaration module <name> { <type declarations> <constant declarations> <exception declarations> <interface declarations> }

  9. Interface declaration interface <name> [:inheritance] { <type declarations> <constant declarations> <exception declarations> <attribute declarations> <method declarations> }

  10. Method declaration <return type> <name> (<parameters>) [raises <exceptions>] [context] ; • Method parameters can be: • in: sent to the server • out: received from the server • inout: both directions

  11. Attribute declaration attribute string name ; readonlyattribute short age ; • Attributes: • are declared as variables • get and set methods are provided

  12. An interface definition example module Animals { // Interface for a dog interface Dog : Animal { // a public attribute attribute integer age; // an exception that can be raised exception notInterested (string why);

  13. An interface definition example // public methods void Bark (in short duration) raises (notInterested) ; void Sit (in string local) raises (notInterested) ; void Play (in Dogfriend) raises (notInterested) ; boolean Alive () ; } }

  14. IDL - exemplo module Escola { interface Curso; // declarado, mas não definido interface Estudante { attributestring nome; attributeunsigned long matricula; exception ClasseLotada; void registra (in Curso curso) raises (ClasseLotada); exception ReqIncompleto; void gradua ( ) raises (ReqIncompleto); typedefsequence<Curso>ListaCursos; ListaCursos cursos_registrados(); } }

More Related