Skip to content

Commit 9bb5713

Browse files
committed
Documentation.
1 parent c2e2e97 commit 9bb5713

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

docs/protocol.rst

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,23 @@ follows.
6565
: B;set_led: Set LED brightness. @brightness: Brightness.\0
6666
\0
6767

68-
For more complex objects, like Tuples, Objects and Vectors, some more syntax is
69-
needed to communicate their structure to the host.
68+
For more complex objects, like Tuples and Vectors, some more syntax is needed
69+
to communicate their structure to the host.
7070

71-
A Tuple type is encoded as a compound type, e.g., ``hB`` (a 16-bit integer and
72-
a byte). It can be recognised by the absence of a space between the type
73-
signatures. Note that a concatenated or nested Tuple type can not be recognised
74-
from its signature, e.g., ``hB`` concatenated with ``ff`` is indistinguishable
75-
from ``hBff``.
76-
77-
An Object type is encoded as a compound type like a Tuple, but its type
78-
signature is enclosed in parentheses ``(`` and ``)``, which makes it possible
71+
A Tuple type is encoded as a compound type enclosed in parentheses ``(`` and
72+
``)``, e.g., ``(hB)`` (a 16-bit integer and a byte).
73+
The parentheses make it possible
7974
to communicate its structure to the host, e.g., the concatenation of ``(hB)``
80-
and ``(ff)`` is ``(hB)(ff)`` and the type signature of a nested Object may look
75+
and ``(ff)`` is ``(hB)(ff)`` and the type signature of a nested Tuple may look
8176
like this ``((hB)(ff))``.
8277

8378
A Vector type signature is enclosed in brackets ``[`` and ``]``. So a vector of
8479
16-bit integers will have as type signature ``[h]``.
8580

86-
Finally, any arbitrary combination of Tuples, Objects and Vectors can be made,
87-
resulting in type signatures like ``[((hB)f)]``, i.e., a Vector of Objects that
88-
contain a Tuple of which the first element is an other Object ``(hB)`` and
89-
the second element is a float ``f``.
81+
Finally, any arbitrary combination of Tuples and Vectors can be made, resulting
82+
in type signatures like ``[((hB)f)]``, i.e., a Vector of Tuples of which the
83+
first element is an other Tuple ``(hB)`` and the second element is a float
84+
``f``.
9085

9186

9287
Remote procedure calls
@@ -99,9 +94,9 @@ parameters, their values are written to the I/O device. After the parameter
9994
values have been received, the device executes the method and writes its return
10095
value (if any) back to the I/O device.
10196

102-
All native C types (``int``, ``float``, ``double``, etc.), Tuples, Objects,
103-
Vectors and any combination of these are currently supported. The host is
104-
responsible for packing and unpacking of the values.
97+
All native C types (``int``, ``float``, ``double``, etc.), Tuples, Vectors and
98+
any combination of these are currently supported. The host is responsible for
99+
packing and unpacking of the values.
105100

106101

107102
.. _struct: https://docs.python.org/3.5/library/struct.html#format-strings

docs/usage.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,19 @@ Arbitrary combinations of these higher order objects can be made to construct
173173
complex objects.
174174

175175
In the following example, we create a 2-dimensional matrix of integers, a
176-
Vector of Tuples and an Object containing an integer, a Vector and an other
177-
Object respectively.
176+
Vector of Tuples and a Tuple containing an integer, a Vector and an other
177+
Tuple respectively.
178178

179179
.. code-block:: cpp
180180
181181
Vector<Vector<int> > matrix;
182182
183183
Vector<Tuple<int, char> > v;
184184
185-
Object<int, Vector<int>, Object<char, long> > o;
185+
Tuple<int, Vector<int>, Tuple<char, long> > t;
186186
187-
These objects can be used for parameters as well as for return values. Note
188-
that these objects, like any higher order data structure should be passed by
187+
These objects can be used as parameters as well as return values. Note that
188+
these objects, like any higher order data structure should be passed by
189189
reference.
190190

191191

0 commit comments

Comments
 (0)