One way of using type information is in requesting data. For structures, these type descriptions can be used to specify a particular field of interest. Note that nested structures can be accessed this way also. A small example will help explain. Let's assume Breezy gives the client application the following type information:
class valAttributes {
char *color;
float threeDPosition[3];
}
class simpleElem {
int i;
class valAttributes *attr;
float vals[100][100];
}
Assume the client further finds that there is a variable
myDistArray that is a distributed two-dimensional
array of simpleElem elements (by retrieving program state
information using Breezy). Breezy would represent such a
structure as follows:
DistributedArray (simpleElem)
myDistArray[20][20];
We can now retrieve all of the elements in the variable
myDistArray or a particular element (by specifying
the indices in the distributed array of the particular element).
We can also retrieve a specific field of the element(s) by
specifying its name.
retrieveData "myDistArray", "vals"The above call would retrieve the data pointed to by the
vals field of the myDistArray variable.
This specificity is recursive, so we could further grab the
threeDPosition field of the attr field, which
is a class itself.
retrieveData "myDistArray", "attr",
"threeDPosition"
This returns the values in the float array pointed to by the
threeDPosition field in the valAttributes class. All
of these requests could be repeated for a particular element
by specifying the index of the element. For example
to retrieve element indexed by (4,5):
retrieveDataFromElem "myDistArray",
"vals", 4, 5