3-14
SOMobjects Base Toolkit Programmer’s Reference Manual
Return Value
The contents method returns a sequence of pointers to objects contained within the
specified Container object.
Example
Here is a code fragment written in C that uses the contents method:
#include <containr.h>
...
Container anObj;
Environment *ev;
sequence(Contained) sc;
long i;
...
sc = Container_contents (anObj, ev, ”all”, TRUE);
printf (”%s contains the following objects:\n”,
SOMObject_somIsA (anObj, _Contained) ?
Contained__get_name ((Contained) anObj, ev) :
”The Interface Repository”);
for (i=0; i<sc._length; i++) {
printf (”\t%s\n”,
Contained__get_name (sc._buffer[i], ev));
SOMObject_somFree (sc._buffer[i]);
}
if (sc._length)
SOMFree (sc._buffer);
else
printf (”\t[none]\n”);
Original Class
Container
Related Information
Methods: describe_contents, lookup_name
Komentarze do niniejszej Instrukcji