Code Monkey home page Code Monkey logo

dccontainers's Introduction

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:

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.

dccontainers's People

Contributors

dsapolska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

royqh1979 jonikdk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.