[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Asside from eieio-default-superclass
, EIEIO comes with some
additional classes that you can use. By using multiple inheritance, it
is possible to use several features at the same time.
12.1 eieio-instance-inheritor | Enable value inheritance between instances. | |
12.2 eieio-singleton | Only one instance of a given class. | |
12.3 eieio-persistent | Enable persistence for a class. | |
12.4 eieio-named | Use the object name as a :name field. | |
12.5 eieio-speedbar | Enable speedbar support in your objects. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
eieio-instance-inheritor
This class is in package `eieio-base'.
Instance inheritance is a mechanism whereby the value of a slot in object instance can reference the parent instance. If the parent's slot value is changed, then the child instance is also changed. If the child's slot is set, then the parent's slot is not modified.
nil
.
To use this class, inherit from it with your own class.
To make a new instance that inherits from and existing instance of your
class, use the clone
method with additional parameters
to specify local values.
The eieio-instance-inheritor
class works by causing cloned
objects to have all slots unbound. This class' slot-unbound
method will cause references to unbound slots to be redirected to the
parent instance. If the parent slot is also unbound, then
slot-unbound
will throw an slot-unbound
signal.
This class is in 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.
defvar
. This symbol will
serve as the variable used as a master list of all objects of the given
class.
:AFTER
method.
It adds new instances to the master list. Do not overload this method
unless you use call-next-method.
equal
is used for comparison.
The paramter list-symbol is the variable symbol which contains the
list of objects to be searched.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
eieio-singleton
This class is in package `eieio-base'.
make-instance
will always return the same object.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
eieio-persistent
This class is in package `eieio-base'.
If you want an object, or set of objects to be persistent, meaning the
slot values are important to keep saved between sessions, then you will
want your top level object to inherit from eieio-persistent
.
To make sure your persistent object can be moved, make sure all file
names stored to disk are made relative with
eieio-persistent-path-relative
.
:file
is the file name in which this
object will be saved.
Class allocated slot file-header-line is used with method
object-write
as a header comment.
All objects can write themselves to a file, but persistent objects have several additional methods that aid in maintaining them.
object-write
for standard-object
, but will derive
a header line comment from the class allocated slot if one is not
provided.
eieio-persistent
object
previously written with eieio-persistent-save
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
eieio-named
This class is in package `eieio-base'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
eieio-speedbar
This class is in package `eieio-speedbar'.
If a series of class instances map to a tree structure, it is possible to cause your classes to be displayable in Speedbar. @xref{Top,,,speedbar}. Inheriting from these classes will enable a speedbar major display mode with a minimum of effort.
speedbar-make-tag-line
for the exp-button-type
argument @xref{Extending,,,speedbar}.
The slot buttonface is the face to use for the text of the string
displayed in speedbar.
The slots buttontype and buttonface are class allocated
slots, and do not take up space in your instances.
eieio-speedbar
and initializes
buttontype and buttonface to appear as directory level lines.
eieio-speedbar
and initializes
buttontype and buttonface to appear as file level lines.
To use these classes, inherit from one of them in you class. You can use multiple inheritance with them safely. To customize your class for speedbar display, override the default values for buttontype and buttonface to get the desired effects.
Useful methods to define for your new class include:
speedbar-item-info-file-helper
.
eieio-speedbar-object-children
.
In this method, use techniques specified in the Speedbar manual. @xref{Extending,,,speedbar}.
Some other functions you will need to learn to use are:
Read the Extending chapter in the speedbar manual for more information on how speedbar modes work @xref{Extending,,,speedbar}.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.