Difference between revisions of "OpenIGTLink/ProtocolV2/Type/AssociativeArray"
From NAMIC Wiki
Line 49: | Line 49: | ||
| colspan=3 align="left" style="background:#f0f0f0;"|... | | colspan=3 align="left" style="background:#f0f0f0;"|... | ||
|- | |- | ||
− | | align="left" | NAME ( | + | | align="left" | NAME (NELEMENTS-1) |
− | | align="left" | char[NAMELEN ( | + | | align="left" | char[NAMELEN (NELEMENTS-1)] |
| align="left" | Name | | align="left" | Name | ||
|- | |- |
Revision as of 22:08, 17 November 2010
Home < OpenIGTLink < ProtocolV2 < Type < AssociativeArrayContents
Summary
Associative Array type is designed to transfer multiple pairs of key and values (associative array) to the receiver. The message format supports key as an array of ASCII code with length less than 256 bytes, and value as an N-dimensional array of 8-, 16-, 32- and 64-bit singed and unsigned integer and 32- and 64-bit float. Maximum 256 dimensions is supported and up to 65536 pairs can be listed in the format. The format consists of data table, which specifies type and size of keys and values, followed by an array of key strings and values.
Message Types
AARRAY
Data | Type | Description |
NELEMENTS | uint16 | Number of elements |
FORMAT 0 | ||
TYPE 0 | uint8 | Data type (0: string, 1: scalar, 2: vector) |
NAMELEN 0 | uint 8 | Name length |
... | ||
FORMAT (NELEMENTS-1) | ||
TYPE (NELEMENTS-1) | uint8 | Data type (0: string, 1: scalar, 2: vector) |
NAMELEN (NELEMENTS-1) | uint 8 | Name length |
NAME Table | ||
NAME 0 | char[NAMELEN] | Name |
... | ||
NAME (NELEMENTS-1) | char[NAMELEN (NELEMENTS-1)] | Name |
Padding* | uint8 or none | padding to align DATA with WORD |
DATA | ||
DATA 0 | TYPE 0 | Data content |
DATA 1 | TYPE 1 | Data content |
... | ||
DATA (NELEMENTS-1) | TYPE (NELEMENTS-1) | Data content |
In C/C++, the size of padding is determined by:
((NAMELEN0 + NAMELEN1 + ... ) % 2 == 0) ? 0 : 1
GET_AARRAY
Data | Type | Description |
STT_AARRAY
Data | Type | Description |
STP_AARRAY
Data | Type | Description |
RTS_AARRAY
Implementations
The AARRAY message type is implemented in the following source code.
Contributors
Junichi Tokuda, Yuichiro Hayashi