3-9
Interface Repository Framework Reference
Example
Here is a code fragment written in C that uses the describe method:
#include <containd.h>
#include <attribdf.h>
#include <somtc.h>
. . .
AttributeDef attr; /* An AttributeDef object (also a Contained) */
Description desc; /* .value field will be an AttributeDescription
*/
AttributeDescription *ad;
Environment *ev;
. . .
desc = Contained_describe (attr, ev);
ad = (AttributeDescription *) desc.value._value;
printf (”Attribute name: %s, defined in: %s\n”,
ad–>name, ad–>defined_in);
printf (”Attribute type: ”);
TypeCode_print (ad–>type, ev);
printf (”Attribute mode: %s\n”, ad–>mode == AttributeDef_READONLY ?
”READONLY” : ”NORMAL”);
SOMFree (desc.value._value); /* Finished with describe output */
SOMObject_somFree (attr); /* Finished with AttributeDef object
*/
Original Class
Contained
Related Information
Methods: within
Comentários a estes Manuais