By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,819 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,819 IT Pros & Developers. It's quick & easy.

Hashtable Memory Dump?

P: n/a
Hello all,

I have written a hashtable class that holds a dyanically allocated array
of structs which holds data about a visualization model. This data is
parsed via xerces from XML into this hashtable. This method works well
for small < 100K files, but I'm looking to handle 3MB files. To speed
things up, I think it would be nice to dump the hashtable to a file so
that I may undump it into memory next time the program is run. I have
no clue how to do this other than writing it out via iostream which
would give me an equivilent of flat XML file and require a ton of
processing. I would like to do something simular to SGI's OpenGL
Performer PFB format. Any thoughts?

Thanks,
-Otto Barnes

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Otto Barnes <si**@verizon.net> wrote in message
news:bg**********@solaris.cc.vt.edu...
Hello all,

I have written a hashtable class that holds a dyanically allocated array
of structs which holds data about a visualization model. This data is
parsed via xerces from XML into this hashtable. This method works well
for small < 100K files, but I'm looking to handle 3MB files. To speed
things up, I think it would be nice to dump the hashtable to a file so
that I may undump it into memory next time the program is run. I have
no clue how to do this other than writing it out via iostream which
would give me an equivilent of flat XML file and require a ton of
processing. I would like to do something simular to SGI's OpenGL
Performer PFB format. Any thoughts?


If you want to serialize your data, the only facility
available for that in standard C++ is via iostreams.

You can write your data in any format you like (prefer
text if you want the data to be portable among platforms).
I don't see what the problem is. If you want to store the
data as text, create an inserter and an extractor for your
class. If you want to store the data 'raw', use
'std::ofstream::write()', and read it back with
'std::ifstream::read().'

-Mike

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.