Cluster lib/storage

 

Provides storage classes of all kind.

  ->See description

BIJECTIVE_DICTIONARY

Bijective associative memory.


 
COLLECTION

Common abstract definition of a sequenceable collection of objects.


 
COLLECTION2

Abstract definition of a 2 dimensional collection of elements of type E_.


 
COLLECTION3

Abstract definition of a 3 dimensional collection of elements of type E_.


 
DICTIONARY

Associative memory.


 
DOUBLE_DICTIONARY
 
QUEUE

A Queue of elements of type E_.


 
REPOSITORY

A REPOSITORY for objects of type O_ can be viewed as a DICTIONARY[O_, STRING] (i.e. objects of type O_ are stored using key names which are actually ordinary STRINGs).


 
SET

Definition of a mathematical set of objects.


 
SIMPLE_DICTIONARY

Basic dictionaries (assymmetry value / key) (class akin to DOUBLE_DICTIONARY)


 
STACK

A Stack of elements of type E_.


 

->

Description

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:

Concepts

Storage objects all provide the same kind of features regarding to the access to elements (iteration). In fact, they provide two iteration patterns:

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

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 ARRAYs, 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

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

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

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.