Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dsapolska/dccontainers
Delphi containers library
https://github.com/dsapolska/dccontainers
delphi delphi-component delphi-library delphi7 hashmap
Last synced: about 2 months ago
JSON representation
Delphi containers library
- Host: GitHub
- URL: https://github.com/dsapolska/dccontainers
- Owner: dsapolska
- License: mit
- Created: 2019-01-17T12:24:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-01-18T12:31:39.000Z (over 5 years ago)
- Last Synced: 2024-01-27T09:09:14.944Z (5 months ago)
- Topics: delphi, delphi-component, delphi-library, delphi7, hashmap
- Language: Pascal
- Size: 43.9 KB
- Stars: 11
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-pascal - DCContainers - black tree (Other non-visual)
README
# DCContainers
Delphi containers library written for Delphi 7 as replacement for formerly used TStringList and DeCAL library.
It contains maps and sets, both with integer and string keys, where maps can store strings, integers and objects (descendants of TObject).#### Technical note:
Each container require object manager (or better say "provider") and hash generator. Ownership of both objects is taken by container, and so they are released when it is destroyed.
Object manager provides and manages life cycle of TDCTreeKeyValue records stored in red-black tree. Currently there is only one implementation internally storing objects in list.
Hash generator calculates hashes of key values, and currently there is only one generator implementing Bob Jenkins' 32 bit hash lookup3.#### Library uses (and depends on):
* DUnit - to compile and execute tests
* crc/hash library by Wolfgang Ehrhardt - for calculating BJL3 hashes
* RBTree by Freek van Walderveen, Jani Mátyás - for Red-Black tree implementation#### Sample usage:
```delphi
map : TDCMapString;
dcptr : PDCTreeKeyValue;map:=TDCMapString.Create(TDCManagerList.Create, TDCHashBJL3.Create);
map.Add('key1', 'example value');
map.Add('key2', 12345);
//...
dcptr:=map.Find('key1');
if dcptr <> nil then
ShowMessage(dcptr^.Value.AsString);
```More detailed usage can be found in _Tests_.