O my god, a Persistent Object!
Many people are terrified by the concept of a persistent object.
The concept is really quite simple.
inline virtual char* identify() const =0;
inline virtual float GetVolume() const =0;
inline virtual float GetSurface() const =0;
class cylinder : public body {
virtual char* identify() const;
virtual float GetVolume() const;
virtual float GetSurface() const;
// a cylinder is described by
class cube : public body {
virtual char* identify() const;
virtual float GetVolume() const;
virtual float GetSurface() const;
// a cube has just one length to
And that’s the data portion of these classes.
That’s what you would have to store in a file in order to re-create these objects.