Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space IceMaster and version 3.7.1

There are three different two mappings for a Slice dictionary, depending on its key and value type:

Key TypeValue TypeMapped TypeComments
string, enum or numericAnycontainers.MapEnumeration keys must be converted to integers.
structAnyNative struct arraycontainers.Map does not support user-defined key types.structclassIce.StructArrayHandleMaps to a handle type to support the Ice run time's unmarshaling requirements.

The mapping generates a class with the same name as the dictionary. This class provides one useful function for applications: a new function that returns an empty instance of the mapped type.

...

We recommend using the new function to reduce the possibility of run-time errors.

 

Ztop

Mapping to struct array

...

Each element of the struct array must have key and value fields whose types are compatible with those of the mapped types for the Slice dictionary's key and value.

Ztop

Mapping to Ice.StructArrayHandle

A dictionary with a structure key type and a class value type maps to Ice.StructArrayHandle. As its name implies, this simple class derives from handle and has a single member that is a struct array:

Code Block
titleMATLAB
classdef StructArrayHandle < handle
    properties
        array
    end
end

You will use the array member as described above for the struct array mapping.

Consider this example:

Code Block
languageslice
titleSlice
struct ID
{
    string symbol;
    string exchange;
}
 
class Quote
{
    double price;
    string currency;
}
 
dictionary<ID, Quote> Quotes;

We can construct this dictionary in MATLAB as follows:

...

titleMATLAB

...

value

...

.

...

Ztop

See Also