Fast multikey map container.
Hello,
I have coded a multikey container using 2 hasmaps. The first hash maps has Name,ID and the second ID, Resource. Everything works ok, but when I want to delete an object by ID I must go through all the Name,ID first checking what name has the object ID I wnat to delete and then delete it from the ID,Resource Hashmap. Is there any other better/fast method?.
Thanks in advance,
HexDump.
Sorry, I think I made a mistake between multikeys and multivalues.
The obvious way is to keep a third table ID -> names. It will probably not be so good depending on how often you remove elements by ID.
The obvious way is to keep a third table ID -> names. It will probably not be so good depending on how often you remove elements by ID.
Hi,
I've written a library called Boost.MultiIndex which precisely allows you to maintain a set of records indexed by more than one field. The library will be shipped with Boost 1.32, due to be available in a matter of weeks. In the meantime you can consult the docs at:
www.boost-consulting.com/boost/libs/multi_index/
Hope this helps,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
I've written a library called Boost.MultiIndex which precisely allows you to maintain a set of records indexed by more than one field. The library will be shipped with Boost 1.32, due to be available in a matter of weeks. In the meantime you can consult the docs at:
www.boost-consulting.com/boost/libs/multi_index/
Hope this helps,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement