ir.idl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. /*
  2. * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
  3. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4. *
  5. * This code is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 only, as
  7. * published by the Free Software Foundation. Oracle designates this
  8. * particular file as subject to the "Classpath" exception as provided
  9. * by Oracle in the LICENSE file that accompanied this code.
  10. *
  11. * This code is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. * version 2 for more details (a copy is included in the LICENSE file that
  15. * accompanied this code).
  16. *
  17. * You should have received a copy of the GNU General Public License version
  18. * 2 along with this work; if not, write to the Free Software Foundation,
  19. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22. * or visit www.oracle.com if you need additional information or have any
  23. * questions.
  24. */
  25. /*
  26. * This file contains OMG IDL from CORBA V2.0, July 1995.
  27. * It also contains the TypeCode creation APIs in CORBA::ORB
  28. **/
  29. #pragma prefix "omg.org"
  30. module CORBA {
  31. typedef string Identifier;
  32. typedef string ScopedName;
  33. typedef string RepositoryId;
  34. enum DefinitionKind {
  35. dk_none, dk_all,
  36. dk_Attribute, dk_Constant, dk_Exception, dk_Interface,
  37. dk_Module, dk_Operation, dk_Typedef,
  38. dk_Alias, dk_Struct, dk_Union, dk_Enum,
  39. dk_Primitive, dk_String, dk_Sequence, dk_Array,
  40. dk_Repository,
  41. dk_Wstring, dk_Fixed,
  42. dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value
  43. dk_Native
  44. };
  45. interface IRObject
  46. /**
  47. An IRObject IDL interface represents the most generic interface
  48. from which all other Interface Repository interfaces are derived,
  49. even the Repository itself.
  50. */
  51. {
  52. // read interface
  53. readonly attribute DefinitionKind def_kind;
  54. // write interface
  55. void destroy ();
  56. };
  57. typedef string VersionSpec;
  58. interface Contained;
  59. interface Repository;
  60. interface Container;
  61. interface Contained : IRObject
  62. /**
  63. The Contained Interface is inherited by all Interface Repository
  64. interfaces that are contained by other objects.
  65. */
  66. {
  67. // read/write interface
  68. attribute RepositoryId id;
  69. attribute Identifier name;
  70. attribute VersionSpec version;
  71. // read interface
  72. readonly attribute Container defined_in;
  73. readonly attribute ScopedName absolute_name;
  74. readonly attribute Repository containing_repository;
  75. struct Description {
  76. DefinitionKind kind;
  77. any value;
  78. };
  79. Description describe ();
  80. // write interface
  81. void move (
  82. in Container new_container,
  83. in Identifier new_name,
  84. in VersionSpec new_version
  85. );
  86. };
  87. interface ModuleDef;
  88. interface ConstantDef;
  89. interface IDLType;
  90. interface StructDef;
  91. interface UnionDef;
  92. interface EnumDef;
  93. interface AliasDef;
  94. interface InterfaceDef;
  95. interface ExceptionDef;
  96. interface ValueDef; // orbos 98-01-18: Objects By Value
  97. interface ValueMemberDef; // orbos 98-01-18: Objects By Value
  98. interface ValueBoxDef; // orbos 98-01-18: Objects By Value
  99. interface NativeDef;
  100. typedef sequence <InterfaceDef> InterfaceDefSeq;
  101. typedef sequence <Contained> ContainedSeq;
  102. struct StructMember {
  103. Identifier name;
  104. TypeCode type;
  105. IDLType type_def;
  106. };
  107. typedef sequence <StructMember> StructMemberSeq;
  108. struct UnionMember {
  109. Identifier name;
  110. any label;
  111. TypeCode type;
  112. IDLType type_def;
  113. };
  114. typedef sequence <UnionMember> UnionMemberSeq;
  115. typedef sequence <Identifier> EnumMemberSeq;
  116. // orbos 98-01-18: Objects By Value -- begin
  117. typedef short Visibility;
  118. const Visibility PRIVATE_MEMBER = 0;
  119. const Visibility PUBLIC_MEMBER = 1;
  120. struct ValueMember {
  121. Identifier name;
  122. RepositoryId id;
  123. RepositoryId defined_in;
  124. VersionSpec version;
  125. TypeCode type;
  126. IDLType type_def;
  127. Visibility access;
  128. };
  129. typedef sequence <ValueMember> ValueMemberSeq;
  130. struct Initializer {
  131. StructMemberSeq members;
  132. };
  133. typedef sequence <Initializer> InitializerSeq;
  134. typedef sequence <ValueDef> ValueDefSeq;
  135. // orbos 98-01-18: Objects By Value -- end
  136. interface Container : IRObject
  137. /**
  138. The Container interface is used to form a containment hierarchy
  139. in the Interface Repository. A Container can contain any number
  140. of objects derived from the Contained interface.
  141. */
  142. {
  143. // read interface
  144. Contained lookup ( in ScopedName search_name);
  145. ContainedSeq contents (
  146. in DefinitionKind limit_type,
  147. in boolean exclude_inherited
  148. );
  149. ContainedSeq lookup_name (
  150. in Identifier search_name,
  151. in long levels_to_search,
  152. in DefinitionKind limit_type,
  153. in boolean exclude_inherited
  154. );
  155. struct Description {
  156. Contained contained_object;
  157. DefinitionKind kind;
  158. any value;
  159. };
  160. typedef sequence<Description> DescriptionSeq;
  161. DescriptionSeq describe_contents (
  162. in DefinitionKind limit_type,
  163. in boolean exclude_inherited,
  164. in long max_returned_objs
  165. );
  166. // write interface
  167. ModuleDef create_module (
  168. in RepositoryId id,
  169. in Identifier name,
  170. in VersionSpec version
  171. );
  172. ConstantDef create_constant (
  173. in RepositoryId id,
  174. in Identifier name,
  175. in VersionSpec version,
  176. in IDLType type,
  177. in any value
  178. );
  179. StructDef create_struct (
  180. in RepositoryId id,
  181. in Identifier name,
  182. in VersionSpec version,
  183. in StructMemberSeq members
  184. );
  185. UnionDef create_union (
  186. in RepositoryId id,
  187. in Identifier name,
  188. in VersionSpec version,
  189. in IDLType discriminator_type,
  190. in UnionMemberSeq members
  191. );
  192. EnumDef create_enum (
  193. in RepositoryId id,
  194. in Identifier name,
  195. in VersionSpec version,
  196. in EnumMemberSeq members
  197. );
  198. AliasDef create_alias (
  199. in RepositoryId id,
  200. in Identifier name,
  201. in VersionSpec version,
  202. in IDLType original_type
  203. );
  204. ExceptionDef create_exception (
  205. in RepositoryId id,
  206. in Identifier name,
  207. in VersionSpec version,
  208. in StructMemberSeq members
  209. );
  210. InterfaceDef create_interface (
  211. in RepositoryId id,
  212. in Identifier name,
  213. in VersionSpec version,
  214. in boolean is_abstract,
  215. in InterfaceDefSeq base_interfaces
  216. );
  217. // orbos 98-01-18: Objects By Value
  218. ValueDef create_value(
  219. in RepositoryId id,
  220. in Identifier name,
  221. in VersionSpec version,
  222. in boolean is_custom,
  223. in boolean is_abstract,
  224. in octet flags, // must be 0
  225. in ValueDef base_value,
  226. in boolean has_safe_base,
  227. in ValueDefSeq abstract_base_values,
  228. in InterfaceDefSeq supported_interfaces,
  229. in InitializerSeq initializers
  230. );
  231. // orbos 98-01-18: Objects By Value
  232. ValueBoxDef create_value_box(
  233. in RepositoryId id,
  234. in Identifier name,
  235. in VersionSpec version,
  236. in IDLType original_type_def
  237. );
  238. NativeDef create_native(
  239. in RepositoryId id,
  240. in Identifier name,
  241. in VersionSpec version
  242. );
  243. };
  244. interface IDLType : IRObject
  245. /**
  246. The IDLType interface is an abstract interface inherited by all
  247. IR objects that represent the OMG IDL types. It provides access
  248. to the TypeCode describing the type, and is used in defining the
  249. other interfaces wherever definitions of IDLType must be referenced.
  250. */
  251. {
  252. readonly attribute TypeCode type;
  253. };
  254. interface PrimitiveDef;
  255. interface StringDef;
  256. interface SequenceDef;
  257. interface ArrayDef;
  258. enum PrimitiveKind {
  259. pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong,
  260. pk_float, pk_double, pk_boolean, pk_char, pk_octet,
  261. pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref
  262. };
  263. interface Repository : Container
  264. /**
  265. Repository is an interface that provides global access to the
  266. Interface Repository. Repository objects can contain constants,
  267. typedefs, exceptions, interfaces, and modules.
  268. */
  269. {
  270. // read interface
  271. Contained lookup_id (in RepositoryId search_id);
  272. PrimitiveDef get_primitive (in PrimitiveKind kind);
  273. // write interface
  274. StringDef create_string (in unsigned long bound);
  275. SequenceDef create_sequence (
  276. in unsigned long bound,
  277. in IDLType element_type
  278. );
  279. ArrayDef create_array (
  280. in unsigned long length,
  281. in IDLType element_type
  282. );
  283. };
  284. interface ModuleDef : Container, Contained
  285. /**
  286. A ModuleDef can contain constants, typedefs, exceptions, interfaces,
  287. and other module objects.
  288. */
  289. {
  290. };
  291. struct ModuleDescription {
  292. Identifier name;
  293. RepositoryId id;
  294. RepositoryId defined_in;
  295. VersionSpec version;
  296. };
  297. interface ConstantDef : Contained
  298. /**
  299. A ConstantDef object defines a named constant.
  300. */
  301. {
  302. readonly attribute TypeCode type;
  303. attribute IDLType type_def;
  304. attribute any value;
  305. };
  306. struct ConstantDescription {
  307. Identifier name;
  308. RepositoryId id;
  309. RepositoryId defined_in;
  310. VersionSpec version;
  311. TypeCode type;
  312. any value;
  313. };
  314. interface TypedefDef : Contained, IDLType
  315. /**
  316. TypedefDef is an abstract interface used as a base interface for
  317. all named non-object types(structures, unions, enumerations,
  318. aliases). The TypedefDef interface is not inherited by the definition
  319. objects for the primitive or anonymous types.
  320. */
  321. {
  322. };
  323. struct TypeDescription {
  324. Identifier name;
  325. RepositoryId id;
  326. RepositoryId defined_in;
  327. VersionSpec version;
  328. TypeCode type;
  329. };
  330. interface StructDef : TypedefDef, Container
  331. /**
  332. A StructDef represents an OMG IDL structure definition.
  333. */
  334. {
  335. attribute StructMemberSeq members;
  336. };
  337. interface UnionDef : TypedefDef, Container
  338. /**
  339. A UnionDef represents an OMG IDL union definition.
  340. */
  341. {
  342. readonly attribute TypeCode discriminator_type;
  343. attribute IDLType discriminator_type_def;
  344. attribute UnionMemberSeq members;
  345. };
  346. interface EnumDef : TypedefDef
  347. /**
  348. A EnumDef represents an OMG IDL enum definition.
  349. */
  350. {
  351. attribute EnumMemberSeq members;
  352. };
  353. interface AliasDef : TypedefDef
  354. /**
  355. An AliasDef represents an OMG IDL typedef that aliases other
  356. definition.
  357. */
  358. {
  359. attribute IDLType original_type_def;
  360. };
  361. interface PrimitiveDef: IDLType
  362. /**
  363. A PrimitiveDef represents one of the IDL primitive types. As
  364. primitive types are unnamed, this interface is not derived from
  365. TypedefDef or Contained.
  366. */
  367. {
  368. readonly attribute PrimitiveKind kind;
  369. };
  370. interface StringDef : IDLType
  371. /**
  372. A StringDef represents an OMG IDL string type. As string
  373. types are anonymous, this interface is not derived from TypedefDef
  374. or Contained.
  375. */
  376. {
  377. attribute unsigned long bound;
  378. };
  379. interface SequenceDef : IDLType
  380. /**
  381. A SequenceDef represents an OMG IDL sequence type. As sequence
  382. types are anonymous, this interface is not derived from TypedefDef
  383. or Contained.
  384. */
  385. {
  386. attribute unsigned long bound;
  387. readonly attribute TypeCode element_type;
  388. attribute IDLType element_type_def;
  389. };
  390. interface ArrayDef : IDLType
  391. /**
  392. An ArrayDef represents an OMG IDL array type. As array
  393. types are anonymous, this interface is not derived from TypedefDef
  394. or Contained.
  395. */
  396. {
  397. attribute unsigned long length;
  398. readonly attribute TypeCode element_type;
  399. attribute IDLType element_type_def;
  400. };
  401. interface ExceptionDef : Contained, Container
  402. /**
  403. An ExceptionDef represents an exception definition.
  404. */
  405. {
  406. readonly attribute TypeCode type;
  407. attribute StructMemberSeq members;
  408. };
  409. struct ExceptionDescription {
  410. Identifier name;
  411. RepositoryId id;
  412. RepositoryId defined_in;
  413. VersionSpec version;
  414. TypeCode type;
  415. };
  416. enum AttributeMode {ATTR_NORMAL, ATTR_READONLY};
  417. interface AttributeDef : Contained
  418. /**
  419. An AttributeDef represents the information that defines an
  420. attribute of an interface.
  421. */
  422. {
  423. readonly attribute TypeCode type;
  424. attribute IDLType type_def;
  425. attribute AttributeMode mode;
  426. };
  427. struct AttributeDescription {
  428. Identifier name;
  429. RepositoryId id;
  430. RepositoryId defined_in;
  431. VersionSpec version;
  432. TypeCode type;
  433. AttributeMode mode;
  434. };
  435. enum OperationMode {OP_NORMAL, OP_ONEWAY};
  436. enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT};
  437. struct ParameterDescription {
  438. Identifier name;
  439. TypeCode type;
  440. IDLType type_def;
  441. ParameterMode mode;
  442. };
  443. typedef sequence <ParameterDescription> ParDescriptionSeq;
  444. typedef Identifier ContextIdentifier;
  445. typedef sequence <ContextIdentifier> ContextIdSeq;
  446. typedef sequence <ExceptionDef> ExceptionDefSeq;
  447. typedef sequence <ExceptionDescription> ExcDescriptionSeq;
  448. interface OperationDef : Contained
  449. /**
  450. An OperationDef represents the information that defines an
  451. operation of an interface.
  452. */
  453. {
  454. readonly attribute TypeCode result;
  455. attribute IDLType result_def;
  456. attribute ParDescriptionSeq params;
  457. attribute OperationMode mode;
  458. attribute ContextIdSeq contexts;
  459. attribute ExceptionDefSeq exceptions;
  460. };
  461. struct OperationDescription {
  462. Identifier name;
  463. RepositoryId id;
  464. RepositoryId defined_in;
  465. VersionSpec version;
  466. TypeCode result;
  467. OperationMode mode;
  468. ContextIdSeq contexts;
  469. ParDescriptionSeq parameters;
  470. ExcDescriptionSeq exceptions;
  471. };
  472. typedef sequence <RepositoryId> RepositoryIdSeq;
  473. typedef sequence <OperationDescription> OpDescriptionSeq;
  474. typedef sequence <AttributeDescription> AttrDescriptionSeq;
  475. interface InterfaceDef : Container, Contained, IDLType
  476. /**
  477. An InterfaceDef object represents an interface definition. It can
  478. contains constants, typedefs, exceptions, operations, and
  479. attributes.
  480. */
  481. {
  482. // read/write interface
  483. attribute InterfaceDefSeq base_interfaces;
  484. attribute boolean is_abstract;
  485. // read interface
  486. boolean is_a (in RepositoryId interface_id);
  487. struct FullInterfaceDescription {
  488. Identifier name;
  489. RepositoryId id;
  490. RepositoryId defined_in;
  491. VersionSpec version;
  492. boolean is_abstract;
  493. OpDescriptionSeq operations;
  494. AttrDescriptionSeq attributes;
  495. RepositoryIdSeq base_interfaces;
  496. TypeCode type;
  497. };
  498. FullInterfaceDescription describe_interface();
  499. // write interface
  500. AttributeDef create_attribute (
  501. in RepositoryId id,
  502. in Identifier name,
  503. in VersionSpec version,
  504. in IDLType type,
  505. in AttributeMode mode
  506. );
  507. OperationDef create_operation (
  508. in RepositoryId id,
  509. in Identifier name,
  510. in VersionSpec version,
  511. in IDLType result,
  512. in OperationMode mode,
  513. in ParDescriptionSeq params,
  514. in ExceptionDefSeq exceptions,
  515. in ContextIdSeq contexts
  516. );
  517. };
  518. struct InterfaceDescription {
  519. Identifier name;
  520. RepositoryId id;
  521. RepositoryId defined_in;
  522. VersionSpec version;
  523. RepositoryIdSeq base_interfaces;
  524. };
  525. // orbos 98-01-18: Objects By Value -- begin
  526. interface ValueMemberDef : Contained
  527. /** A <code>ValueMemberDef</code> object represents the public
  528. and private data member definition of a <code>Value</code> type
  529. */
  530. {
  531. readonly attribute TypeCode type;
  532. attribute IDLType type_def;
  533. attribute Visibility access;
  534. };
  535. interface ValueDef : Container, Contained, IDLType
  536. /**
  537. A ValueDef object represents the definition of the
  538. <code>Value</code> object used to pass the object state
  539. between hosts
  540. */
  541. {
  542. // read/write interface
  543. attribute InterfaceDefSeq supported_interfaces;
  544. attribute InitializerSeq initializers;
  545. attribute ValueDef base_value;
  546. attribute ValueDefSeq abstract_base_values;
  547. attribute boolean is_abstract;
  548. attribute boolean is_custom;
  549. attribute octet flags; // always 0
  550. attribute boolean has_safe_base;
  551. // read interface
  552. boolean is_a(in RepositoryId value_id);
  553. struct FullValueDescription {
  554. Identifier name;
  555. RepositoryId id;
  556. boolean is_abstract;
  557. boolean is_custom;
  558. octet flags; // always 0
  559. RepositoryId defined_in;
  560. VersionSpec version;
  561. OpDescriptionSeq operations;
  562. AttrDescriptionSeq attributes;
  563. ValueMemberSeq members;
  564. InitializerSeq initializers;
  565. RepositoryIdSeq supported_interfaces;
  566. RepositoryIdSeq abstract_base_values;
  567. boolean has_safe_base;
  568. RepositoryId base_value;
  569. TypeCode type;
  570. };
  571. FullValueDescription describe_value();
  572. // write interface
  573. ValueMemberDef create_value_member(
  574. in RepositoryId id,
  575. in Identifier name,
  576. in VersionSpec version,
  577. in IDLType type_def,
  578. in Visibility access
  579. );
  580. AttributeDef create_attribute(
  581. in RepositoryId id,
  582. in Identifier name,
  583. in VersionSpec version,
  584. in IDLType type,
  585. in AttributeMode mode
  586. );
  587. OperationDef create_operation(
  588. in RepositoryId id,
  589. in Identifier name,
  590. in VersionSpec version,
  591. in IDLType result,
  592. in OperationMode mode,
  593. in ParDescriptionSeq params,
  594. in ExceptionDefSeq exceptions,
  595. in ContextIdSeq contexts
  596. );
  597. };
  598. struct ValueDescription {
  599. Identifier name;
  600. RepositoryId id;
  601. boolean is_abstract;
  602. boolean is_custom;
  603. octet flags; // always 0
  604. RepositoryId defined_in;
  605. VersionSpec version;
  606. RepositoryIdSeq supported_interfaces;
  607. RepositoryIdSeq abstract_base_values;
  608. boolean has_safe_base;
  609. RepositoryId base_value;
  610. };
  611. interface ValueBoxDef : IDLType
  612. /** ValueBoxDef is an interface that reresents a value type with
  613. a single data member inside its state section and no
  614. inheritance or methods. For example, when transmitting a
  615. string or sequence as an actual parameter on an interface
  616. operation or as a data member of a value type that is an
  617. actual parameter, it may be important to preserve any sharing
  618. of the string or sequence within the object graph being
  619. transmitted. Because current IDL data types do not preserve
  620. referential integrity in this way, this requirement is
  621. conveniently handled by using a value type. Value types also
  622. support the transmission of nulls (as a distinguished value),
  623. whereas IDL data types such as string and sequence (which are
  624. mapped to empty strings and sequences) do not. The Java to IDL
  625. mapping requires both preservation of referential integrity
  626. and transmission of nulls. Because it would be cumbersome to
  627. require the full IDL syntax for a value type for this specific
  628. usage, this shorthand notation is introduced to cover this use
  629. of value types for simple containment of a single data member.
  630. */
  631. {
  632. attribute IDLType original_type_def;
  633. };
  634. // orbos 98-01-18: Objects By Value -- end
  635. interface NativeDef : TypedefDef {
  636. };
  637. };