<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sorry, while changing the sample in the process of formulating the
questions the remaining sample data were posted wrongly in my last
mail! :(<br>
<br>
On 23.06.2011 12:13, rony wrote:
<blockquote cite="mid:4E0311DC.6010907@wu.ac.at" type="cite">
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
Hi there, <br>
<br>
while contemplating the marshalling of multidimensional arrays I could
not find definitive answers, hence turning to this list, requesting
some answers (even as short as "yes" and "no"):<br>
<ul>
<li>given an array with two dimensions (signature: aas) and the
following set elements:<br>
<blockquote>
<pre>arr[0,0]="a"
arr[0,1]="b"
arr[0,2]="c"
arr[1,0]="A" /* no values for: arr[1,1], arr[1,2] */
arr[2,2]="3" /* no values for: arr[2,0], arr[2,1] */
</pre>
</blockquote>
</li>
</ul>
</blockquote>
Maybe a matrix form depicts the array better, where "-" indicates no
entry/empty:<br>
<blockquote>
<pre>x/y | 0 1 2
----+----------
0 | a b c
1 | A - -
2 | - - 3
</pre>
</blockquote>
<pre>
</pre>
<blockquote cite="mid:4E0311DC.6010907@wu.ac.at" type="cite">
<ul>
<li>
<blockquote> </blockquote>
</li>
<li>Questions:</li>
<ul>
<li>Unassigned elements (like <strike>arr[1,0]</strike>, which
in some languages
could be marked explicitly as NULL/.nil) cannot be dropped (left-out) ?</li>
</ul>
</ul>
</blockquote>
The above array should read: "... (like arr[1,1] ...".<br>
<br>
<br>
<blockquote cite="mid:4E0311DC.6010907@wu.ac.at" type="cite">
<ul>
<ul>
<ul>
<li>If must be given, then short of an explicit NULL/.nil
sentinel value one needs to use <br>
</li>
<ul>
<li>An empty (0-length) string for string-like types (string,
object_path, signature) ?</li>
<li>The value 0 for all simple types?<br>
<br>
</li>
</ul>
</ul>
<li>Which would be the marshalling sequence in the above example,
assuming that unassigned elements are represented by empty strings in
this case?</li>
<ol>
<li>[0,0], [0,1], [0,2], [1,0], [1,1], [1,2], [2,0], [2,1],
[2,2], hence the element sequence: "a", "b", "c", "A", "", "", "",
"", "3" ?<br>
or:<br>
</li>
<li><strike>[0,0], [1,0], [2,0], [1,1], [2,1], [3,1], [1,2],
[2,2], [2,3]
hence the element sequence: "a", "A", "", "b", "", "", "c", "", "3" ?<br>
</strike></li>
</ol>
</ul>
</ul>
</blockquote>
The "2." above should read: <br>
<blockquote>2. [0,0], [1,0], [2,0], [0,1], [1,1], [2,1], [0,2], [1,2],
[2,2]
hence the element sequence: "a", "A", "", "b", "", "", "c", "", "3" ?</blockquote>
<br>
<blockquote cite="mid:4E0311DC.6010907@wu.ac.at" type="cite">
<ul>
<ul>
<li>Given the above example, would it be o.k. to leave out
"trailing
empty elements of the array"? <br>
E.g. in case 1. marshalling above, this would yield the sequence
(arr[1,1] and arr[1,2] are left out; the array's dimension can still be
defined by open_container/close_container):</li>
<ol>
<li>[0,0], [0,1], [0,2], [1,0], <strike>[1,1],</strike> [2,0],
[2,1], [2,2], hence
the element sequence: "a", "b", "c", "A", "", "", "3"<br>
</li>
</ol>
</ul>
</ul>
</blockquote>
The above should read:<br>
<blockquote>[0,0], [0,1], [0,2], [1,0], [2,0], [2,1], [2,2], hence
the element sequence: "a", "b", "c", "A", "", "", "3"</blockquote>
<br>
<blockquote cite="mid:4E0311DC.6010907@wu.ac.at" type="cite">
<ul>
<ul>
<li>Is it possible to marshall an empty array by merely using a
sequence of open_container(DBUS_TYPE_ARRAY) - no-content -
close_container?<br>
(Thought that it was prohibited, but have not been able to find
references for this)?<br>
</li>
</ul>
</ul>
</blockquote>
Again, sorry for the confusing data in my initial mail. <br>
<br>
What would be the answers?<br>
<br>
---rony<br>
</body>
</html>