Reputation: 109 Stalwart
- Active Members
- Active Posts:
- 257 (0.22 per day)
- 24-October 10
- Profile Views:
- Last Active:
- Oct 28 2013 03:56 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 24 Aug 2012dy = they? odr = other? fns = ?? At least you've provided some code now... but don't do that, I don't want to have to decipher the content as well as he meaning of your posts.
The method I provided doesn't defeat the point in using a hash table. You'll have relatively bad insertion and removal times, but you'll have stable search times, as if there was only one map.
Maybe you should consider the actual use of your data, will it mostly be inserted? Will it mostly be deleted? Will it mostly be searched? How many entries are you expecting in general use? How many entries would there be in the most extreme usage? Is memory limited? Is a hash table really the correct data structure to use? If it is then I suppose searching speed is very important to you, go with the solution I provided.
I'm not spending any more time on this thread.
Posted 23 Aug 2012Within the container, it will still have to go through all the hashtables and remove references to the object being deleted. But wasn't going through all the all hashtables exactly what the OP was trying to avoid?
It isn't possible to use one hash table, or map, for multiple key look-ups (when excluding a multi-index primary key) while keeping the search efficiency high. You'd resort to linear look-ups, which defeats the point in using a hash table or map. If you've interpreted it correctly then he's asking for the impossible.
Posted 23 Aug 2012No, as I don't provide any method of searching or deleting, that is your job. My comment about overloading the subscript operator for different data types indicates that you will be able to search using any type - the type will determine which map to do the look up on. If you have multiple fields with the same data type, you won't be able to use the subscript operator. Instead you'll have to implement a find function that is told which map to use.
In the confusing 1 line of code, the 'first' is actually std::pair::first, not my_type::first, which is why I had to explain it in more detail. I'll edit it to remove the ambiguity. I also left out a bit of code, that's fixed now.
Posted 23 Aug 2012Surprisingly, you don't need to know too much assembly, but it certainly helps to understand the lower level details, especially when you come to debug. You could use somebody else's boot loader to get you in to 32 bit mode.
The link I provided for the x86 architecture also has the x86_64 docs, which is what you want for the i5's (and any modern PC processor) 64-bit support, the i5 may have extensions you can make use of, but it will conform to the x86_64 and x86 docs.
They are pretty overwhelming as well, you should use them as a reference and read more introductory articles on OS development, don't be put off.
Posted 23 Aug 2012It'll depend on your processor architecture, you should download the developer manual for whatever processor you're working with (here's Intel's x86's: http://www.google.co...DMbSBXxnivKNw). Here's a web page I'm sure you'll find useful: http://www.brokentho...es/OSDev19.html
If you're using a USB keyboard and you're bypassing the BIOS (protected mode 32, or developing a proper driver), you have a lot more work to do.
It's quite easy to work with the keyboard using BIOS routines, you should search for how to do that.
- Member Title:
- D.I.C Regular
- 28 years old
- November 24, 1985
- Programming Languages:
- C, C++, assembly.
- Click here to e-mail me