Docs » Autodocs » intuition.library » NextObject
NextObject -- iterate through the object on an Exec list. (V36)
object = NextObject( objectPtrPtr ) D0 A0 APTR NextObject( APTR );
This function is for boopsi class implementors only. When you collect a set of boopsi objects on an Exec List structure by invoking their OM_ADDMEMBER method, you can (only) retrieve them by iterations of this function. Works even if you remove and dispose the returned list members in turn.
Initially, you set a pointer variable to equal the lh_Head field of the list (or mlh_Head field of a MinList). You pass the *address* of that pointer repeatedly to NextObject() until it returns NULL.
/* here is the OM_DISPOSE case of some class's dispatcher */ case OM_DISPOSE: /* dispose members */ object_state = mydata->md_CollectionList.lh_Head; while ( member_object = NextObject( &object_state ) ) { DoMethod( member_object, OM_REMOVE ); /* remove from list */ DoMethodA( member, msg ); /* and pass along dispose */ }
Returns pointers to each object in the list in turn, and NULL when there are no more.
DisposeObject(), SetAttrs, GetAttr(), MakeClass(), Document "Basic Object-Oriented Programming System for Intuition", and the "boopsi Class Reference" document.
|