This actually works...
int cube::commit(const char * filename) const
ofstream *f = new ofstream(filename);
cube::cube(const char * filename)
ifstream *f = new ifstream(filename);
int cylinder::commit(const char * filename) const
ofstream *f = new ofstream(filename);
cylinder::cylinder(const char * filename)
ifstream *f = new ifstream(filename);
We write out and read back the data to and from a file.
Well, of course you have to hand-craft the “commit” function for each and every class you design.
As well as the “restore” constructor.
This can get tedious and boring after a while
and this is precisely where the OODB system comes in.