Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Proposal on *Index: access via hash value
Proposal on *Index: access via hash value [message #20678] Tue, 31 March 2009 13:37 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Recently I`ve rewritten a number of classes from VectorMap towards heavily Index usage. But IMO this class lacks access by hash value. To show why it is important I`ll give an example of typical situation.
Let`s imagine I have a number of CollectionElement class objects. Each object is identified by it`s unique value. Hash value is derived from this unique id. I do also have a number of another objects which contain information based on CollectionElement-s. To keep this system serializable, I refer to CollectionElements by their unique ids. The problem arises when I try to get requested object by this id. *Index class has no means to reach object by it`s hash. Once found, I would certainly use FindNext() - so multi-keying isn`t problem here.
You may say that there`s a *Map class, and it gives me access by id value. But IMO in this sutiation it is more than needed. Using *Map will make me duplicate keys: internal CollectElement object id is duplicated as the *Map key. It doesn`t seem quite well.
May be it will be really iseful to add something like
bool AIndex::Check(unsigned _hash);
int AIndex::FindFirst(_hash);
?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with Core/Mt.h Mutex and RWMutex
Next Topic: .ini file
Goto Forum:
  


Current Time: Sat May 10 00:24:58 CEST 2025

Total time taken to generate the page: 0.02600 seconds