Dictionary Definitions in RAD Modules

You can use dictionaries to add a data structure in which the key-value pair mappings can be stored and retrieved. The following example shows how to use the dictionary tag.

<dictionary>
  <key type="<key type>">
  <value type="<value type>">
</dictionary>

You can use the dictionary type similar to any other RAD type such as a field in a structure, a method argument or a return value, a property, an error payload, or as an event payload.

Example 2-4 Defining a Dictionary for RAD

This example shows how to define a dictionary with a key type of integer and value type of string as a read-write property.

...
  <property name="DictProp" access="rw" >
     <dictionary>
        <key type="integer" />
        <value type="string" />
     </dictionary>
  </property>
... 

Values can be of any type except for list and dictionary. The value can be a derived type or a reference, use the "type" tag. However, the key must belong to any one of the following basic types:

  • boolean

  • integer

  • unsigned integer

  • long

  • unsigned long

  • float

  • double

  • time

  • string

  • name