add.C


#include <iostream.h>
#include "body.h"
#include "cube.h"
#include "cylinder.h"

main()
{
ooHandle(ooDBObj)     dbH;

if( dbH.exist(oovTopFD, "Bodies") )
{ if (dbH.open(oovTopFD, "Bodies", oocUpdate) != oocSuccess)
  { cout << "dbH.open error" << endl;
    return 1;
  }
}
else
{ cout << "Database Bodies not existing" << endl;
  return 1;
}


ooHandle(body) cu,cy;

cu = new cube(2.5);
cout << "------- Cube:" << endl;
cout << "Volume:  " << cu->GetVolume() << endl;
cout << "Surface: " << cu->GetSurface() << endl; 
cout << "Type:    " << cu->identify() << endl; 

cy = new cylinder (2., 5.);
cout << "------- Cylinder:" << endl;
cout << "Volume:  " << cy->GetVolume() << endl;
cout << "Surface: " << cy->GetSurface() << endl; 
cout << "Type:    " << cy->identify() << endl; 

if( oovTopTrans.commit() != oocSuccess )
  cout << "transaction commit error" << endl;
}