#include "DBInquire.h" #include "TurboDaqDB.h" #include // example of application using the PixConfDBInterface to get informations from the Data Base using namespace pixlib; int main(){ try{ // first of all the application should instanziate a data base ... PixConfDBInterface * myDB = new TurboDaqDB("Ge_18.cfg"); // second: get the root node of the configuration tree DBInquire* root = myDB->readRootRecord(1); // third: access to the datafield of root record {for(DBInquire::fieldIterator it = root->fieldBegin(); it != root->fieldEnd(); it++) { cout << it << endl; string name; myDB->DBProcess(it, READ, name); } } // 4th: access to the subrecord of root record and their datafield {for(DBInquire::recordIterator it = root->recordBegin(); it != root->recordEnd(); it++) { cout << it << endl; for(DBInquire::fieldIterator ft = it->fieldBegin(); ft != root->fieldEnd(); ft++) { cout << ft << endl; } } } } catch(PixConfDBInterface::exception exc){ std::cout << exc.message.c_str() << std::endl; exit(1); } catch(...){ std::cout << "unexpected exception" << std::endl; throw; } return 0; }