Saving content of classes without files

Hello,

How can I store the contents off the class structure itself?

I have a file which I read in to a program. It processes the file and populates various containers, which subsequently populates other containers.

The overhead generated by reading the file is huge, and it only needs to happen once. How can I eliminate having to create the class structure each time I open the file through the program?
closed account (Lv0f92yv)
Not sure you can... Maybe look into multitasking multithreading to reduce overhead... If possible.
Last edited on
What exactly do You mean by "create the class structure each time"?...

DidnĀ“t You say, that You read the file only once?... so why do You use it multiple times? O_o...
Where do You create Your container objects?(show us the code)...
Last edited on
Google "c++ serialization".
You cannot escape files, but you can use something that better matches your class...
Good luck!
Hello,

@Incubbus:
Well assume I have an empty class structure. Certain classes have containers: (multi)maps, vectors, lists and such) .
The interface takes a file and processes it (which is a fairly complex operation, with lots of O(n*) operations). The latter entails filling the class structure .
Once the class structure is filled, the program can be used, which is in essence class operations.

If the file isn't changed, the class structure must be filled on each load. Which is fairly pointless as the input file is static, and the class structure is filled over and over again, for no real reason, if one could save the contents of all classes somewhere.

@Duoas:
Yes, this is what I need. I will fiddle around with the search results and see what I can do. I shall post results later...

Thank you all for your time and expertise.
Topic archived. No new replies allowed.