diff options
author | Erlang/OTP <[email protected]> | 2010-12-14 17:21:22 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-12-14 17:21:22 +0100 |
commit | 34f7f62caf25ef159b63ca4f080e212b8726675f (patch) | |
tree | aa7df62e86bc519858bf7bde7b5106a5a5c48772 /lib/orber/doc/src/ch_idl_to_erlang_mapping.xml | |
parent | caa311d4a2b5fb229d9369c7667b062b34945b36 (diff) | |
parent | 98a66242abe688d852ec46f4298a364fc0124995 (diff) | |
download | otp-34f7f62caf25ef159b63ca4f080e212b8726675f.tar.gz otp-34f7f62caf25ef159b63ca4f080e212b8726675f.tar.bz2 otp-34f7f62caf25ef159b63ca4f080e212b8726675f.zip |
Merge branch 'nick/orber/recursive_types/OTP-8868' into maint-r13
* nick/orber/recursive_types/OTP-8868:
Support for recursive unions and structs. Break loop if recursive TypeCode.
Added basic tests for recursive uinions and structs.
Removed test code.
Added partial support for recursive IDL types.
Diffstat (limited to 'lib/orber/doc/src/ch_idl_to_erlang_mapping.xml')
-rw-r--r-- | lib/orber/doc/src/ch_idl_to_erlang_mapping.xml | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml index a97ad65f0e..964ae3e92d 100644 --- a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml +++ b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>1997</year><year>2009</year> + <year>1997</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -445,7 +445,19 @@ void op(in myEnum a);</cell> <section> <title>Struct Data Type</title> <p>A <c>struct</c> may have Basic, Template, Scoped Names and Constructed - types as members.</p> + types as members. By using forward declaration we can define a recursive struct:</p> + <code type="none"><![CDATA[ +struct myStruct; // Forward declaration +typedef sequence<myStruct> myStructSeq; +struct myStruct { + myStructSeq chain; +}; + +// Deprecated definition (anonymous) not supported by IC +struct myStruct { + sequence<myStruct> chain; +}; + ]]></code> </section> <section> @@ -510,6 +522,25 @@ union LongUnion2 switch(long) { default: boolean DefaultValue; }; </code> + <p>In the same way as structs, unions can be recursive if forward + declaration is used (anonymous types is deprecated and not supported):</p> + <code type="none"><![CDATA[ +// Forward declaration +union myUnion; +typedef sequence<myUnion>myUnionSeq; +union myUnion switch (long) { + case 1 : myUnionSeq chain; + default: boolean DefaultValue; +}; + ]]></code> + + <note> + <p>Recursive types (union and struct) require Light IFR. I.e. the + IC option {light_ifr, true} is used and that Orber is configured in such a way that + Light IFR is activated. Recursive TypeCode is currently not supported, which is + why these cannot be encapsulated in an any data type.</p> + </note> + </section> <warning> <p>Every field in, for example, a struct must be initiated. Otherwise @@ -890,7 +921,7 @@ attribute long RWAttribute; object internal state with its object reference. The object internal state is an Erlang term which has a format defined by the user.</p> <note> - <p>It is is not always the case that the internal state will be the first parameter, as stubs can use their own object reference as the first parameter (see the IC documentation).</p> + <p>It is not always the case that the internal state will be the first parameter, as stubs can use their own object reference as the first parameter (see the IC documentation).</p> </note> <p>A function call will invoke an operation. The first parameter of the function should be the object reference and then |