WiringProject / Wiring

Wiring Framework
http://wiring.org.co/
Other
217 stars 168 forks source link

HashMap library by alessandro1105 (Alessandro Pasqualini) #32

Open alessandro1105 opened 11 years ago

alessandro1105 commented 11 years ago

i've used this library on my project and it worked successfully.

AlexanderBrevig commented 11 years ago

Hi Alessandro! Thank you for your contribution :)

I've adopted it to meet Wiring 'standards' and removed the #include Arduino.h and fixed a destructor bug.

Could you do me a favor and try this version with your project? Copy HashMap.h from here https://github.com/AlexanderBrevig/Wiring/tree/master/framework/libraries/HashMap put(hash, value) now also overwrite the hashmap for an existing hash, demonstrated in the new HelloHashMap sketch that is included in the linked version.

The minor changes to the API is as follows (may not be a complete list): length() -> count() getValue() -> valueFor(hash), valueAt(index) and value() getKey() -> keyFor(value), keyAt(index), and key()

Hope to hear from you soon! Let me know if you want another for of attribution in the HashMap.h file

Best regards, /Alexander

alessandro1105 commented 11 years ago

Hi ! At the moment i can't try the new version of the library. I will test is as soon as possible.

Thanks