/*
* Read through all objects of ABC type on disk
*
* Uses dynamic_cast(pobj)
*
* Sequencially reads through all objects
*
*/
#include
#include
#include "POBroker.h"
#include "example.h"
int main()
{
POBroker pob("TEST.DAT");
pob.register_create_function(typeid(ABC).name(), ABC::create);
POBObj* pobj;
ABC* pabc;
unsigned long oi;
do {
oi = pob.readObj(pobj);
cout << "oi=" << oi << endl;
if ( pabc = dynamic_cast(pobj) ) {
cout << "Read Object:" << endl;
cout << *pabc << endl;
}
pob.deleteRef(pabc);
} while ( ! pob.eof() );
return 0;
}