Jump to content
  • Advertisement
Sign in to follow this  
HexDump

Fast multikey map container.

This topic is 5404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!