A look at the code
class body : public ooObj {
ooRef(Tag) tag <-> list[];
inline virtual char* identify() const =0;
inline virtual float GetVolume() const =0;
inline virtual float GetSurface() const =0;
class Tag: public ooObj {
ooRef(body) list[] <-> tag;
friend ostream & operator << (ostream &os, const Tag &tag);
ostream & operator << (ostream &, const Tag &);
This is the syntax for a bi-directional one-to-many happy relationship.
And here we make a Tag (key) object and give it 20 or so Body objects.
The green keywords are placement instructions, so we keep “keys” /Tags away from the data…
theTag = new(dbTag) Tag();
for (float x = 1; x < 5.; x += 0.5)
cy = new(dbH) cylinder (x, x*2.);