[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]

blob::iter::memory(n) 1 doc "Blob. General content storage with deduplication"

Name

blob::iter::memory - Blob - In-memory iterator

Table Of Contents

Synopsis

Description

Welcome to the Blob project, written by Andreas Kupries.

For availability please read Blob - How To Get The Sources.

This package provides a blob iterator which holds its associations in memory.

Class API

::blob::iter::memory create obj ?sortmode?

This constructor command creates a new instance obj of the class and returns the fully qualified name of that instance.

The sortmode is an option suitable for use with the builting command lsort, and controls the sorting order. It defaults to -ascii.

::blob::iter::memory new ?sortmode?

This constructor command creates a new instance of the class and returns the fully qualified name of that instance.

The sortmode is an option suitable for use with the builting command lsort, and controls the sorting order. It defaults to -ascii.

Standard API

As a derived class of blob::iter instances of this class provide the following methods to their users:

<instance> add uuid value

This method associates the property_value with the blob specified by its uuid. The result of the method is the empty string. An error is thrown if the uuid is already associated with a value. This means that each uuid can only be associated with a single value, although each value can have multiple uuids associated with it.

<instance> remove uuid

This method removes the specified uuids from the iterator. The result of the method is the empty string. Unknown uuids are ignored. If a removed uuid is the current uuid the iterator is stepped forward to the next entry in sequence, as per the iterator's direction and ordering configuration.

<instance> data! tuples

This method is a bulk variant of add, see above. It expects a list of (uuid,value) pairs as argument and makes the necessary associations.

The result of the method is the empty string. An error is thrown if any of the specified uuids is already associated with a value, before any changes are made.

<instance> clear

This method removes all uuid from the iterator. After the call the instance is empty. The result of the method is the empty string.

<instance> reset

This method resets the cursor of the iterator to the start position (as per the direction/ordering of the iterator). The result of the method is an empty string.

<instance> reverse

This method reverses the direction of the iterator. The result of the method is an empty string.

<instance> next n

This method moves the cursor forward by n entries, in the current direction. The result of the method is a boolean value which indicates if the step moved beyond the end of the iterator (true), or not (false). The step-length n must be an integer > 0.

<instance> previous n

This method moves the cursor backward by n entries, against the current direction. The result of the method is a boolean value which indicates if the step moved before the start of the iterator (true), or not (false). The step-length n must be an integer > 0.

<instance> to location

This method moves the cursor of the iterator to the specified absolute location. See method location below for the method which returns such locations, and their format.

<instance> direction! dir

This method sets the direction of iterator relative to the sorting order of the values. The possible arguments are increasing and descreasing. The result of the method is the empty string.

<instance> get uuid

This method locates the value associated with uuid and returns it as its result. An error is thrown if uuid is not known to the instance.

<instance> exists uuid

This method returns a boolean value indicating if the uuid is known to the iterator (true), or not (false).

<instance> size

This method determines the number of uuid/value associations stored in the iterator and returns that number as the result of the method.

<instance> at n

This method takes the n entries of the iterator starting at the cursor and going forward, and retrurns them as its result. The result is a list of entries, each entry represented by a (uuid,value) pair. The entries are stored in the order they were taken from the iterator.

The method does not move cursor. This is the responsibility of the methods next and previous.

<instance> direction

This method determines the current direction of the iterator relative to the sort order and returns it as its result. The two possible results are increasing and decreasing

<instance> location

This method determines the location of the cursor and returns it as its result. The format of the result is a pair of values, a location code, and details, in this order. The possible location codes are

start

The cursor is before the start of the content. The detail value is the empty string.

end

The cursor is behind the end of the content. The detail value is the empty string.

at

The cursor is at a specific entry in the iterator. The detail value specifies that entry. It is a pair denoting the current property value, and the uuid, in this order.

<instance> data

This method retrieves the iterator content and returns it as a list of (uuid,value)-pairs. This is the same format as taken by method data! as input.

<instance> --> dst

This method copies the contents of the instance to the iterator instance dst. Any preexisting content of the destination instance is replaced with the information from this iterator. The targeted instance has to support the methods reset, clear, direction!, data!, and to. The result of the method is the empty string.

<instance> := src

This method copies the contents of iterator src to this iterator. Any preexisting content of this iterator is replaced with the information from the source. The source instance has to support the methods direction, data, and location. The result of the method is the empty string.

Bugs, Ideas, Feedback

Both the package(s) and this documentation will undoubtedly contain bugs and other problems. Please report such at Blob Tickets.

Please also report any ideas you may have for enhancements of either package(s) and/or documentation.

Keywords

blob, blob storage, content deduplication, content storage, deduplication, storage