示例#1
0
void AirportLoader::printResults(std::ostream& sout)
{
   Airport airport;
   Runway runway;
   Ils ils;
   for (int i = 0; i < nql; i++) {

      // print the AIRPORT record
      AirportKey* apk = static_cast<AirportKey*>(ql[i]);
      airport.setRecord( db->getRecord( apk->idx ) ) ;
      airport.printRecord(sout);

      // print the airport's RUNWAY records
      for (RunwayKey* rwk = apk->runways; rwk != 0; rwk = rwk->next) {

         runway.setRecord( dbGetRecord( rwk ) );
         sout << "Runway: ";
         runway.printRecord(sout);

         // print the runway's ILS records
         for (IlsKey* ilsk = rwk->ils; ilsk != 0; ilsk = ilsk->next) {
            ils.setRecord( dbGetRecord( ilsk ) );
            sout << "ILS:    ";
            ils.printRecord(sout);
         }

      }

   }
}
const char* Database::getRecord(const int n, const int size)
{
   const char* p = nullptr;
   if (n >= 0 && n < nql) {
      p = dbGetRecord( ql[n], size );
   }
   return p;
}