Overview
========

All code separated into 3 several levels.

![levels](levels.png)

Actual implementation of algorithms placed in `*_impl.inc` files. Each of these files starts with brief description of the algorithm it implements.

| File | Algorithm |
| ---- | --------- |
| [dmap_hashbuckets_impl.inc](dmap_hashbuckets_impl.inc) | Hash table with separate chaining |

On implementation level only main methods implemented. For example, for maps main methods are `Insert(Key, const Value)`, `Find(const Key, out Value)` and `Delete(const Key)` (arguments depend on specialization defines).

On the second level actual implementations are specialized with several define options in `*_impl.pas` files. Main options are

* Allocator
    * `default`: rtl `GetMem`/`FreeMem`
    * `static`: via generic parameter
* Size of value in the collection
    * `static`: determines via generic parameter
    * `dynamic`: values are variable length and length will be passed in functions
    * `fixed`: size passes into constructor of a collection
* Type of value
    * `raw`: just some bytes
    * `managed`: e.g. AnsiString or COM interface
* Strategies (e.g. grow strategy)
* The way hash function determines (for hash maps)
    * `static`
    * `parametric`: hash function is constructor argument
    * `external`: hash values passes explicit each time key passes

And others. There are exponantional number of combinations of these options, however not all of them are useful.
