Next: , Previous: , Up: Base Classes   [Contents][Index]

12.2 eieio-instance-tracker

This class is defined in the package eieio-base.

Sometimes it is useful to keep a master list of all instances of a given class. The class eieio-instance-tracker performs this task.

Class: eieio-instance-tracker tracker-symbol

Enable instance tracking for this class. The slot tracker-symbol should be initialized in inheritors of this class to a symbol created with defvar. This symbol will serve as the variable used as a master list of all objects of the given class.

Method on eieio-instance-tracker: initialize-instance obj slot

This method is defined as an :after method. It adds new instances to the master list. Do not overload this method unless you use call-next-method.

Method on eieio-instance-tracker: delete-instance obj

Remove obj from the master list of instances of this class. This may let the garbage collector nab this instance.

eieio-instance-tracker-find: key slot list-symbol

This convenience function lets you find instances. key is the value to search for. slot is the slot to compare KEY against. The function equal is used for comparison. The parameter list-symbol is the variable symbol which contains the list of objects to be searched.