Common Lisp Package: WEBLOCKS-MEMORY

A driver for weblocks backend store API that uses memory and has no disk backing. This is useful for prototyping, testing, temporary operations, etc.

README:

FUNCTION

Public

MAKE-SCRATCH-STORE (&OPTIONAL LIST)

Accepts an optional list of objects, and creates a memory store from them.

OBJECTS-FROM-SCRATCH-STORE (STORE)

Accepts a memory store and returns a list of objects stored in it.

ORDER-OBJECTS-IN-MEMORY (SEQ ORDER-BY)

Orders objects in 'seq' according to 'order-by'.

RANGE-OBJECTS-IN-MEMORY (SEQ RANGE)

Selects only the objects in 'range' from 'seq'.

Private

FIND-PERSISTENT-OBJECTS-AUX (STORE CLASS-NAME)

Finds persistent objects of a given class.

GET-ROOT-OBJECT (STORE OBJECT-NAME)

Returns a root object from the store.

SETFGET-ROOT-OBJECT (VALUE STORE OBJECT-NAME)

Sets a root object in the store.

REMOVE-ROOT-OBJECT (STORE OBJECT-NAME)

Deletes a root object from the store.

GENERIC-FUNCTION

Public

EQUIVALENTP (A B)

Returns true if 'a' is in some sense equivalent to 'b'. This function is used by the framework for sorting data.

STRICTLY-LESS-P (A B)

Returns true if 'a' is strictly less than 'b'. This function is used by the framework for sorting data.

SLOT-ACCESSOR

Private

MEMORY-STORE-ROOT-OBJECTS (OBJECT)

Stores objects that represent an alternative to RDBMS tables, that further store object instances.

SETFMEMORY-STORE-ROOT-OBJECTS (NEW-VALUE OBJECT)

Stores objects that represent an alternative to RDBMS tables, that further store object instances.

PERSISTENT-OBJECTS-OF-CLASS-BY-ID (OBJECT)

A hashmap with keys being object IDs, and values being object instances.

SETFPERSISTENT-OBJECTS-OF-CLASS-BY-ID (NEW-VALUE OBJECT)

A hashmap with keys being object IDs, and values being object instances.

PERSISTENT-OBJECTS-OF-CLASS-NEXT-ID (OBJECT)

The ID of the last created object. When objects are created, this slot is incremented and its value is used to automatically generate object IDs.

SETFPERSISTENT-OBJECTS-OF-CLASS-NEXT-ID (NEW-VALUE OBJECT)

The ID of the last created object. When objects are created, this slot is incremented and its value is used to automatically generate object IDs.

CLASS

Public

MEMORY-STORE

A weblocks backend that stores all data in memory without disk backing.

Private

PERSISTENT-OBJECTS-OF-CLASS

This class represents an alternative to RDBMS table, holding object instances of a given class.