|
-
December 20th, 2003, 04:59 PM
#1
Complicated use of Hash_maps (or something else)
I'm working on a "Scripting Engine" of my, and i'm having problems with something:
My engine has object structure like that:
Code:
File
File.Open()
Screen
Screen.Write()
Screen.Draw()
Error()
Execute()
Net
Net.Socket
Net.Socket.Open
Net.HTMLParser
Net.HTMLParser.Parse()
Net.HTTP
Net.HTTP.Download()
Net.HTTP.Upload()
(hasn't yet been implemented)
Now, I plan to store those identifiers in multiple nested hash_maps. The root (top) hash_map would include Top elements (Screen, File, Error() above) in pair (String, Identifier):
Code:
struct Identifier{
int Type; // INT, STRING, BOOL, Object ...
void *Value;
}
Identifier.Value may point to real value (like 100 if INT, 'c' if char, address of a function...),
but if it's a object (like Screen above), it would point to another hashtable containing it's elements (Write() and Draw() above)
(Please, if you don't get it, message me and i will try to explain a bit better)
Is there any faster way to deal with this?
Anybody knows it?
Last edited by MTom; December 20th, 2003 at 05:03 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|