Provides storage classes of all kind. We call "storage objects" instances of classes that can store many objects of the same kind.
There are many kinds of storage classes:
Storage objects all provide the same kind of features regarding to the access to elements (iteration). In fact, they provide two iteration patterns:
lib/iterator
cluster. This cluster also provides natural differenciation between abstractions and their implementations. All the
abstractions are in the lib/storage
cluster, while the
implementations reside each in a sub-cluster reflecting the abstraction their classes refer to. The exceptions
are STACK
and QUEUE
which stand on their own.
Collections are sequences of object than can be directly accessed by their index. That's what is called "lists" in other libraries. See also collection2 (indexed matrices) and collection3 (indexed 3D matrices)
On the implementation side, we have the classical ARRAY
s, but
also lists (single- or double-linked). There is also the FAST_ARRAY
, a zero-bound array, and the RING_ARRAY
which is a ring buffer.
Dictionaries are sets of couples (key, value). Each key is unique in the dictionany. Bijective-dictionaries have a stronger constraint: each value is also unique.
There are two families of implementation: hashed-based
dictionaries (using hashable objects, see the lib/abilities
cluster) and AVL-based dictionaries (using comparable objects in a balanced tree, and
ensuring the iteration order to be growing).
Sets are groups of objects. Each object can only be once in a set; all that can be known about an object is, is it in the set or not. Multi-sets allow objects to be several times in the group, associationg a counter with each object (note: multi-sets are not yet available).
The implementations are quite similar to the dictionaries: there are hashed-based and AVL-based sets, with the same constraints and properties than the dictionaries.
Repositories are very special objects. They are designed to contain STORABLE
objects. Those objects can be stored or retrieve, usign
resp. the update
command which updates the repository, and the commit
command which
commits the repository to its underlying medium (whatever that is: stream, database, and so on).
Where and how those objects are retrieved, is of no concern of this deferred class. There is currently one available implementation: a stream-based, XML-based repository.