[DGD] Show all cloned objects

Par Winzell zell at skotos.net
Mon Jun 17 20:32:15 CEST 2002


>>Is there a way to get an array with all the object_names for all cloned
>>objects of a certain base object?
> 
> If one has an object manager in the mudlib, this would be a
> fairly natural thing for it to keep track of, if the driver
> doesn't do so (and I don't think the driver does, although
> I am not certain of that).
> 
> It might be a little memory-intensitve, if the object manager
> stores that information, or a little CPU-intensive, if it
> searches a list of all objects. Either way, this is something
> I would avoid invoking where possible.

The most obvious way to do this seems to me to have the clonable object 
as the head of a double linked list. This adds an overhead to all clones 
of two variables -- not a terrible price to pay for what I'd consider an 
absolutely vital piece of book-keeping.

The traditional, no-object-manager approach is, of course, just this:

for (i = 0; i < sizeof(status()[ST_OTABSIZE]); i ++) {
   if (find_object("/foo/bar#" + i)) {
     /* got one */
   }
}

which is perfectly adequate for emergency maintenance and such (for 
example, if you ever needed to recreate the linked list mentioned above).

Zell

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list