[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. API


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Variables

Variable: *nuke-existing-classes* Default NIL

Determines wether or not to override existing classes when restoring a CLOS Class. If *nuke-existing-classes* is not NIL the current definition will be overridden.

Variable: *store-class-superclasses* Default NIL

If *store-class-superclasses* is not NIL when storing a CLOS Class all superclasses will be stored.

Variable: *store-class-slots* Default T

If *store-class-slots* is NIL slots which are class allocated will not be serialized when storing objects.

Variable: *nuke-existing-packages* Default NIL

If *nuke-existing-packages* is non-nil then packages which already exist will be deleted when restoring packages.

Variable: *store-used-packages* Default NIL

The variable determines how packages on a package use list will be serialized. If non-nil the the package will be fully serialized, otherwise only the name will be stored.

Variable: *store-hash-size* Default 50

The default size of the hash-table created to keep track of objects which have already been stored. By binding the variable to a suitable value you can avoid the consing involved by rehashing hash-tables.

Variable: *restore-hash-size* Default 50

The default size of the hash-table created to keep track of objects which have already been restored. By binding the variable to a suitable value you can avoid the consing involved by rehashing hash-tables.

Variable: *check-for-circs* Default t

Binding this variable to nil when storing or restoring an object inhibits all checks for circularities which gives a severe boost to performance. The downside of this is that no restored objects will be eq and attempting to store circular objects will hang. The speed improvements are definitely worth it if you know that there will be no circularities or shared references in your data (eg spam-filter hash-tables).

Variable: *default-backend*

The backend that will be used by default.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Functions

Generic: store object place &optional (backend *default-backend*)

Stores object into place using backend. Place must be either a stream or a pathname-designator. All conditions signalled from store can be handled by catching store-error. If the store-error is not handled the causing error will be signalled.

Generic: restore place &optional (backend *default-backend*)

Restores an object serialized using store from place using backend. Place must be either a stream or a pathname-designator. Restore is setffable eg.

 
(store 0 "/tmp/counter")
(incf (restore "/tmp/counter"))

All conditions signalled from restore can be handled by catching restore-error. If the restore-error is not handled the causing error will be signalled.

Function: find-backend name &optional (errorp nil)

Return backup called name. If there is no such backend NIL is returned if errorp is false, otherwise an error is signalled.

Function: caused-by cl-store-error

Returns the condition which caused cl-store-error to be signalled.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Macros

Macro: with-backend backend &body body

Execute body with *default-backend* bound to the backend designated by backend.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Conditions

Condition: cl-store-error

Class Precedence: condition

Root CL-STORE Condition all errors occuring while storing or restoring can be handled by catching cl-store-error

Condition: store-error

Class Precedence: cl-store-error

A store-error will be signalled when an error occurs within store or multiple-value-store. The causing error can be obtained using (caused-by condition)

Condition: restore-error

Class Precedence: cl-store-error

A restore-error will be signalled when an error occurs within restore. The causing error can be obtained using (caused-by condition)


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Sean on September, 1 2005 using texi2html 1.76.