IDL Syntax - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

IDL Syntax

Description:

Concise (OMG specification in 36 pages) C preprocessor directives (-fno-cpp) ... enum enumeg {hi, med, lo}; void opeg1(in long longname) ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 9
Provided by: db2a2
Category:
Tags: idl | enum | syntax

less

Transcript and Presenter's Notes

Title: IDL Syntax


1
IDL Syntax
  • Declarative - no programming statements, a
    language independent way of describing interfaces
  • Used to generate Stubs and Skeletons
  • Based on C syntax
  • Concise (OMG specification in 36 pages)
  • C preprocessor directives (-fno-cpp)
  • Multiple Inheritance

2
IDL Syntax (II)
  • Constants
  • Data type declarations
  • Basic types (char, float etc)
  • Constructed types (array, struct etc)
  • Attributes - get and set a particular value
  • Operations - methods
  • Exceptions
  • Interfaces
  • Modules - name space scoping

3
IDL Basic Types
4
IDL Constructed Types
  • Structures
  • struct structeg
  • string colour
  • long age
  • Enumerations
  • enum enumeg blue, yellow, green
  • Exceptions
  • exception NumberTooBigException
  • string reason
  • long id

5
Other IDL types
  • Sequences
  • 1-D array with max size (fixed at compile time)
    and length (fixed at run time)
  • typedef sequence ltfloatgt floatseq
  • typedef sequence ltfloat, 42gt boundedfloatseq
  • typedef sequence ltfloatseqgt floatfloatseq
  • Arrays
  • Multidimensional fixed size array
  • typedef float42 floatvector
  • typedef float422 floatmatrix

6
  • Typedefs and Operations
  • interface examplebase_example
  • const short consteg 42
  • typedef stringconsteg stringarrayeg
  • exception exceptioneg
  • enum enumeg hi, med, lo
  • void opeg1(in long longname)
  • char opeg2(in stringarrayeg saname) raises
    execptioneg
  • void opeg3(in float p1, inout float p2, out
    float p3)
  • oneway opeg4(in enumeg enname)
  • attribute double deg1
  • readonly attribute octet oceg1
  • double get_deg1() // get method
  • void set_deg1(in double value) // set
    method
  • octet get_oceg1() // get method

7
PIDL
  • Define ORB interfaces using Pseudo-IDL
  • PIDL references cannot be passed as parameters to
    real CORBA objects
  • module CORBA //PIDL
  • typedef string ORBid
  • typedef sequence ltstringgt arg_list
  • ORB ORB_init(inout arg_list argv,
  • in ORBid orb_identifier)
  • interface ORB
  • string object_to_string(in Object obj)
  • Object string_to_object(in string obj)

8
Any
  • Can express any IDL type
  • Logically contains a TypeCode and a value
    described by that TypeCode
  • TypeCode (PIDL) used to identify contents
  • API defined in PIDL to insert/extract values
  • typedef sequence ltanygt anyseq
  • any opeg()
Write a Comment
User Comments (0)
About PowerShow.com