home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / omgidl.zip / ir.idl next >
Text File  |  2002-09-04  |  15KB  |  569 lines

  1. //Updated:  December 1999
  2. //This file contains OMG IDL from  CORBA V2.3 December 1999
  3. //
  4. // OMG IDL from Chapters 1 through 15 CORBA module
  5. //
  6. // Post CORBA 2.3 changes from core RTF bracketed
  7. // in #ifdef CORBA_2_5 ... #endif
  8. //
  9. // Stuff from Messaging specification is bracketed 
  10. // in #ifdef CORBA3 ... #endif
  11.  
  12. #pragma prefix "omg.org"
  13. module CORBA {
  14.  
  15. // Chapter 10 Interface Repository
  16.  
  17.     typedef string Identifier;
  18.     typedef string ScopedName;
  19.     typedef string RepositoryId;
  20.     enum DefinitionKind {
  21.     dk_none, dk_all,
  22.     dk_Attribute, dk_Constant, dk_Exception, dk_Interface,
  23.     dk_Module, dk_Operation, dk_Typedef,
  24.     dk_Alias, dk_Struct, dk_Union, dk_Enum,
  25.     dk_Primitive, dk_String, dk_Sequence, dk_Array,
  26.     dk_Repository,
  27.     dk_Wstring, dk_Fixed,
  28.     dk_Value, dk_ValueBox, dk_ValueMember,
  29.     dk_Native,
  30.     dk_AbstractInterface
  31.     };
  32.     interface IRObject {
  33.     // read interface
  34.     readonly attribute DefinitionKind def_kind;
  35.     // write interface
  36.     void destroy ();
  37.     };
  38.     typedef string VersionSpec;
  39.     interface Contained;
  40.     interface Repository;
  41.     interface Container;
  42.     interface Contained : IRObject {
  43.  
  44.     // read/write interface
  45.     attribute RepositoryId id;
  46.     attribute Identifier name;
  47.     attribute VersionSpec version;
  48.     // read interface
  49.     readonly attribute Container defined_in;
  50.     readonly attribute ScopedName absolute_name;
  51.     readonly attribute Repository containing_repository;
  52.     struct Description {
  53.         DefinitionKind kind;
  54.         any value; 
  55.     }; 
  56.     Description describe ();
  57.     // write interface
  58.     void move (
  59.         in Container         new_container,
  60.         in Identifier         new_name,
  61.         in VersionSpec         new_version
  62.     );
  63.     };
  64.     interface ModuleDef;
  65.     interface ConstantDef;
  66.     interface IDLType;
  67.     interface StructDef;
  68.     interface UnionDef;
  69.     interface EnumDef;
  70.     interface AliasDef;
  71.     interface InterfaceDef;
  72.     interface ExceptionDef;
  73.     interface NativeDef;
  74.     typedef sequence <InterfaceDef> InterfaceDefSeq;
  75.     interface ValueDef;
  76.     typedef sequence <ValueDef> ValueDefSeq;
  77.     interface ValueBoxDef;
  78.     typedef sequence <Contained> ContainedSeq;
  79.     interface AbstractInterfaceDef;
  80.     typedef sequence <AbstractInterfaceDef> AbstractInterfaceDefSeq;
  81.     struct StructMember {
  82.     Identifier                 name;
  83.     TypeCode                 type;
  84.     IDLType                 type_def;
  85.     };
  86.     typedef sequence <StructMember> StructMemberSeq;
  87.     struct Initializer {
  88.     StructMemberSeq             members;
  89.     Identifier                name;
  90.     };
  91.     typedef sequence <Initializer> InitializerSeq;
  92.     struct UnionMember {
  93.     Identifier                 name;
  94.     any                     label;
  95.     TypeCode                 type;
  96.     IDLType                 type_def;
  97.     };
  98.     typedef sequence <UnionMember> UnionMemberSeq;
  99.     typedef sequence <Identifier> EnumMemberSeq;
  100.     interface Container : IRObject {
  101.     // read interface
  102.     Contained lookup (
  103.         in ScopedName             search_name
  104.     );
  105.     ContainedSeq contents (
  106.         in DefinitionKind             limit_type,
  107.         in boolean                 exclude_inherited
  108.     );
  109.     ContainedSeq lookup_name (
  110.         in Identifier             search_name, 
  111.         in long                 levels_to_search, 
  112.         in DefinitionKind             limit_type,
  113.         in boolean                 exclude_inherited
  114.     );
  115.     struct Description {
  116.         Contained                 contained_object; 
  117.         DefinitionKind             kind;
  118.         any                 value; 
  119.     };
  120.     typedef sequence<Description> DescriptionSeq;
  121.     DescriptionSeq describe_contents (
  122.         in DefinitionKind             limit_type,
  123.         in boolean                 exclude_inherited,
  124.         in long                 max_returned_objs
  125.     );
  126.     // write interface
  127.     ModuleDef create_module (
  128.         in RepositoryId             id,
  129.         in Identifier             name,
  130.         in VersionSpec             version
  131.     );
  132.     ConstantDef create_constant (
  133.         in RepositoryId             id,
  134.         in Identifier             name,
  135.         in VersionSpec             version,
  136.         in IDLType                 type,
  137.         in any                 value
  138.     );
  139.     StructDef create_struct (
  140.         in RepositoryId             id,
  141.         in Identifier             name,
  142.         in VersionSpec             version,
  143.         in StructMemberSeq             members
  144.     );
  145.     UnionDef create_union (
  146.         in RepositoryId             id,
  147.         in Identifier             name,
  148.         in VersionSpec             version,
  149.         in IDLType                 discriminator_type,
  150.         in UnionMemberSeq             members
  151.     );
  152.     EnumDef create_enum (
  153.         in RepositoryId             id,
  154.         in Identifier             name,
  155.         in VersionSpec             version,
  156.         in EnumMemberSeq            members
  157.     );
  158.     AliasDef create_alias (
  159.         in RepositoryId             id,
  160.         in Identifier             name,
  161.         in VersionSpec             version,
  162.         in IDLType                 original_type
  163.     );
  164.     InterfaceDef create_interface (
  165.         in RepositoryId             id,
  166.         in Identifier             name,
  167.         in VersionSpec             version,
  168.         in InterfaceDefSeq            base_interfaces
  169.     );
  170.     ValueDef create_value(
  171.         in RepositoryId            id,
  172.         in Identifier            name,
  173.         in VersionSpec            version,
  174.         in boolean                is_custom,
  175.         in boolean                is_abstract,
  176.         in ValueDef                base_value,
  177.         in boolean                is_truncatable,
  178.         in ValueDefSeq            abstract_base_values,
  179.         in InterfaceDefSeq            supported_interfaces,
  180.         in InitializerSeq            initializers
  181.     );
  182.     ValueBoxDef create_value_box(
  183.         in RepositoryId             id,
  184.         in Identifier             name,
  185.         in VersionSpec             version,
  186.         in IDLType                 original_type_def
  187.     );
  188.     ExceptionDef create_exception(
  189.         in RepositoryId             id,
  190.         in Identifier             name,
  191.         in VersionSpec             version,
  192.         in StructMemberSeq             members
  193.     );
  194.     NativeDef create_native(
  195.         in RepositoryId             id,
  196.         in Identifier             name,
  197.         in VersionSpec             version
  198.     );
  199.     AbstractInterfaceDef create_abstract_interface (
  200.         in RepositoryId id,
  201.         in Identifier name,
  202.         in VersionSpec version,
  203.         in AbstractInterfaceDefSeq base_interfaces
  204.     );
  205.     };
  206.  
  207.     interface IDLType : IRObject {
  208.     readonly attribute TypeCode     type;
  209.     };
  210.     
  211.     interface PrimitiveDef;
  212.     interface StringDef;
  213.     interface SequenceDef;
  214.     interface ArrayDef;
  215.     interface WstringDef;
  216.     interface FixedDef;
  217.     enum PrimitiveKind {
  218.     pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong,
  219.     pk_float, pk_double, pk_boolean, pk_char, pk_octet,
  220.     pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref,
  221.     pk_longlong, pk_ulonglong, pk_longdouble, 
  222.     pk_wchar, pk_wstring, pk_value_base
  223.     };
  224.     
  225.     interface Repository : Container {
  226.     // read interface
  227.     Contained lookup_id (in RepositoryId search_id);
  228.     TypeCode get_canonical_typecode(in TypeCode tc); 
  229.     PrimitiveDef get_primitive (in PrimitiveKind kind);
  230.     // write interface
  231.     StringDef create_string (in unsigned long bound);
  232.     WstringDef create_wstring (in unsigned long bound);
  233.     SequenceDef create_sequence (
  234.         in unsigned long         bound,
  235.         in IDLType             element_type
  236.      );
  237.     ArrayDef create_array (
  238.         in unsigned long         length,
  239.         in IDLType             element_type
  240.     );
  241.     FixedDef create_fixed (
  242.         in unsigned short         digits,
  243.         in short             scale
  244.     );
  245.     };
  246.  
  247.     interface ModuleDef : Container, Contained {
  248.     };
  249.  
  250.     struct ModuleDescription {
  251.     Identifier             name; 
  252.     RepositoryId             id; 
  253.     RepositoryId             defined_in;
  254.     VersionSpec             version;
  255.     };
  256.     
  257.     interface ConstantDef : Contained {
  258.     readonly attribute TypeCode type;
  259.     attribute IDLType type_def;
  260.     attribute any value;
  261.     };
  262.     
  263.     struct ConstantDescription {
  264.     Identifier             name; 
  265.     RepositoryId             id; 
  266.     RepositoryId             defined_in; 
  267.     VersionSpec             version;
  268.     TypeCode             type; 
  269.     any                 value; 
  270.     };
  271.     
  272.     interface TypedefDef : Contained, IDLType {
  273.     };
  274.     
  275.     struct TypeDescription {
  276.     Identifier             name; 
  277.     RepositoryId             id; 
  278.     RepositoryId             defined_in; 
  279.     VersionSpec             version;
  280.     TypeCode             type; 
  281.     };
  282.     
  283.     interface StructDef : TypedefDef, Container {
  284.     attribute StructMemberSeq     members;
  285.     };
  286.     
  287.     interface UnionDef : TypedefDef, Container {
  288.     readonly attribute TypeCode     discriminator_type;
  289.     attribute IDLType         discriminator_type_def;
  290.     attribute UnionMemberSeq     members;
  291.     };
  292.  
  293.     interface EnumDef : TypedefDef {
  294.     attribute EnumMemberSeq     members;
  295.     };
  296.     
  297.     interface AliasDef : TypedefDef {
  298.     attribute IDLType         original_type_def;
  299.     };
  300.  
  301.     interface NativeDef : TypedefDef {
  302.     };
  303.  
  304.     interface PrimitiveDef: IDLType {
  305.     readonly attribute PrimitiveKind kind;
  306.     };
  307.     
  308.     interface StringDef : IDLType {
  309.     attribute unsigned long     bound;
  310.     };
  311.     
  312.     interface WstringDef : IDLType {
  313.     attribute unsigned long     bound;
  314.     };
  315.  
  316.     interface FixedDef : IDLType {
  317.     attribute unsigned short     digits;
  318.     attribute short         scale;
  319.     };
  320.  
  321.     interface SequenceDef : IDLType {
  322.     attribute unsigned long     bound;
  323.     readonly attribute TypeCode     element_type;
  324.     attribute IDLType         element_type_def;
  325.     };
  326.  
  327.     interface ArrayDef : IDLType {
  328.     attribute unsigned long     length;
  329.     readonly attribute TypeCode     element_type;
  330.     attribute IDLType         element_type_def;
  331.     };
  332.  
  333.     interface ExceptionDef : Contained, Container {
  334.     readonly attribute TypeCode     type;
  335.     attribute StructMemberSeq     members;
  336.     };
  337.     
  338.     struct ExceptionDescription {
  339.     Identifier             name; 
  340.     RepositoryId             id; 
  341.     RepositoryId             defined_in; 
  342.     VersionSpec             version;
  343.     TypeCode             type; 
  344.     };
  345.     
  346.     enum AttributeMode {ATTR_NORMAL, ATTR_READONLY};
  347.     
  348.     interface AttributeDef : Contained {
  349.     readonly attribute TypeCode     type;
  350.     attribute IDLType         type_def;
  351.     attribute AttributeMode        mode;
  352.     };
  353.     
  354.     struct AttributeDescription {
  355.     Identifier             name; 
  356.     RepositoryId             id; 
  357.     RepositoryId             defined_in; 
  358.     VersionSpec             version;
  359.     TypeCode             type;
  360.     AttributeMode             mode; 
  361.     };
  362.     
  363.     enum OperationMode {OP_NORMAL, OP_ONEWAY};
  364.     enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT};
  365.     struct ParameterDescription {
  366.     Identifier             name; 
  367.     TypeCode             type; 
  368.     IDLType             type_def;
  369.     ParameterMode             mode;
  370.     };
  371.  
  372.     typedef sequence <ParameterDescription> ParDescriptionSeq;
  373.     typedef Identifier ContextIdentifier;
  374.     typedef sequence <ContextIdentifier> ContextIdSeq;
  375.     typedef sequence <ExceptionDef> ExceptionDefSeq;
  376.     typedef sequence <ExceptionDescription> ExcDescriptionSeq;
  377.  
  378.     interface OperationDef : Contained {
  379.     readonly attribute TypeCode    result;
  380.     attribute IDLType         result_def;
  381.     attribute ParDescriptionSeq     params;
  382.     attribute OperationMode     mode; 
  383.     attribute ContextIdSeq         contexts;
  384.     attribute ExceptionDefSeq     exceptions;
  385.     };
  386.  
  387.     struct OperationDescription {
  388.     Identifier             name; 
  389.     RepositoryId             id; 
  390.     RepositoryId             defined_in; 
  391.     VersionSpec             version;
  392.     TypeCode             result; 
  393.     OperationMode             mode; 
  394.     ContextIdSeq             contexts; 
  395.     ParDescriptionSeq         parameters;
  396.     ExcDescriptionSeq         exceptions;
  397.     };
  398.     
  399.     typedef sequence <RepositoryId> RepositoryIdSeq;
  400.     typedef sequence <OperationDescription> OpDescriptionSeq;
  401.     typedef sequence <AttributeDescription> AttrDescriptionSeq;
  402.  
  403.     interface InterfaceDef : Container, Contained, IDLType {
  404.     // read/write interface
  405.     attribute InterfaceDefSeq     base_interfaces;
  406.        // read interface
  407.     boolean is_a (
  408.         in RepositoryId         interface_id
  409.     );
  410.     struct FullInterfaceDescription {
  411.         Identifier             name;
  412.         RepositoryId        id;
  413.         RepositoryId         defined_in;
  414.         VersionSpec         version;
  415.         OpDescriptionSeq         operations;
  416.         AttrDescriptionSeq         attributes;
  417.         RepositoryIdSeq         base_interfaces;
  418.         TypeCode             type;
  419.     };
  420.     FullInterfaceDescription describe_interface();
  421.     // write interface
  422.     AttributeDef create_attribute (
  423.         in RepositoryId         id,
  424.         in Identifier         name,
  425.         in VersionSpec         version,
  426.         in IDLType             type,
  427.         in AttributeMode         mode
  428.     );
  429.     OperationDef create_operation (
  430.            in RepositoryId         id,
  431.         in Identifier         name,
  432.         in VersionSpec         version,
  433.         in IDLType             result,
  434.         in OperationMode         mode, 
  435.         in ParDescriptionSeq     params,
  436.         in ExceptionDefSeq         exceptions,
  437.         in ContextIdSeq         contexts
  438.     );
  439.     };
  440.     
  441.     struct InterfaceDescription {
  442.     Identifier             name; 
  443.     RepositoryId             id; 
  444.     RepositoryId             defined_in; 
  445.     VersionSpec             version;
  446.     RepositoryIdSeq         base_interfaces;
  447.     };
  448.  
  449.     typedef short Visibility;
  450.     const Visibility PRIVATE_MEMBER = 0;
  451.     const Visibility PUBLIC_MEMBER = 1;
  452.  
  453.     struct ValueMember {
  454.     Identifier             name;
  455.     RepositoryId             id;
  456.     RepositoryId             defined_in;
  457.     VersionSpec             version;
  458.     TypeCode             type;
  459.     IDLType             type_def;
  460.     Visibility             access; 
  461.     };
  462.  
  463.     typedef sequence <ValueMember> ValueMemberSeq;
  464.  
  465.     interface ValueMemberDef : Contained {
  466.     readonly attribute TypeCode type;
  467.     attribute IDLType type_def;
  468.     attribute Visibility access;
  469.     };
  470.     
  471.     interface ValueDef : Container, Contained, IDLType {
  472.     // read/write interface
  473.     attribute InterfaceDefSeq supported_interfaces;
  474.     attribute InitializerSeq initializers;
  475.     attribute ValueDef base_value;
  476.     attribute ValueDefSeq abstract_base_values;
  477.     attribute boolean is_abstract;
  478.     attribute boolean is_custom;
  479.     attribute boolean is_truncatable;
  480.     // read interface
  481.     boolean is_a(
  482.         in RepositoryId         id
  483.     );
  484.     struct FullValueDescription {
  485.         Identifier            name;
  486.         RepositoryId        id;
  487.         boolean            is_abstract;
  488.         boolean            is_custom;
  489.         RepositoryId        defined_in;
  490.         VersionSpec            version;
  491.         OpDescriptionSeq        operations;
  492.         AttrDescriptionSeq        attributes;
  493.         ValueMemberSeq        members;
  494.         InitializerSeq        initializers;
  495.         RepositoryIdSeq        supported_interfaces;
  496.         RepositoryIdSeq        abstract_base_values;
  497.         boolean            is_truncatable;
  498.         RepositoryId        base_value;
  499.         TypeCode            type;
  500.     };
  501.     FullValueDescription describe_value();
  502.     ValueMemberDef create_value_member(
  503.         in RepositoryId         id,
  504.         in Identifier         name,
  505.         in VersionSpec         version,
  506.         in IDLType             type,
  507.         in Visibility         access
  508.     );
  509.     AttributeDef create_attribute(
  510.         in RepositoryId        id,
  511.         in Identifier        name,
  512.         in VersionSpec        version,
  513.         in IDLType            type,
  514.         in AttributeMode        mode
  515.     );
  516.     OperationDef create_operation (
  517.         in RepositoryId        id,
  518.         in Identifier        name,
  519.         in VersionSpec        version,
  520.         in IDLType            result,
  521.         in OperationMode        mode,
  522.         in ParDescriptionSeq    params,
  523.         in ExceptionDefSeq        exceptions,
  524.         in ContextIdSeq        contexts
  525.     );
  526.     };
  527.     struct ValueDescription {
  528.     Identifier            name;
  529.     RepositoryId            id;
  530.     boolean             is_abstract;
  531.     boolean                is_custom;
  532.     RepositoryId            defined_in;
  533.     VersionSpec            version;
  534.     RepositoryIdSeq            supported_interfaces;
  535.     RepositoryIdSeq            abstract_base_values;
  536.     boolean                is_truncatable;
  537.     RepositoryId            base_value; 
  538.     };
  539.     
  540.     interface ValueBoxDef : TypedefDef {
  541.     attribute IDLType original_type_def;
  542.     };
  543.     
  544.     interface AbstractInterfaceDef : InterfaceDef {
  545.     };
  546.  
  547.  
  548.     enum TCKind {                
  549. #    pragma version TCKind 2.3
  550.     tk_null, tk_void, 
  551.     tk_short, tk_long, tk_ushort, tk_ulong, 
  552.     tk_float, tk_double, tk_boolean, tk_char, 
  553.     tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, 
  554.     tk_struct, tk_union, tk_enum, tk_string, 
  555.     tk_sequence, tk_array, tk_alias, tk_except,
  556.     tk_longlong, tk_ulonglong, tk_longdouble,
  557.     tk_wchar, tk_wstring, tk_fixed,
  558.     tk_value, tk_value_box,
  559.     tk_native,
  560.     tk_abstract_interface
  561.     };
  562.     
  563.     typedef short ValueModifier;    
  564.     const ValueModifier VM_NONE = 0;
  565.     const ValueModifier VM_CUSTOM = 1;
  566.     const ValueModifier VM_ABSTRACT = 2;
  567.     const ValueModifier VM_TRUNCATABLE = 3;
  568. };
  569.