Changeset 393 in Sophya for trunk/Poubelle/archTOI.old/toiiter.cc
- Timestamp:
- Sep 1, 1999, 11:24:28 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/toiiter.cc
r363 r393 40 40 41 41 auxGPS = NULL; 42 42 43 initDone = false; 43 44 } 44 45 … … 77 78 auxGPS = x.auxGPS; 78 79 if (auxGPS) auxGPS = auxGPS->clone(); 80 81 initDone = x.initDone; 79 82 } 80 83 … … 93 96 94 97 void TOIIter::Init() { 98 if (initDone) return; 99 initDone = true; 95 100 // On a soit un repertoire, soit une liste de fichiers.... 96 101 if (directory == "") { … … 315 320 316 321 bool TOIIter::Next() { 322 if (!initDone) Init(); 317 323 while (1) { 318 324 if (!NextSample()) return false; // end of files … … 365 371 while (file->sameBlockNumAhead()) { // tant que meme numero de bloc, on lit 366 372 if (!file->nextBlock()) { // fin de fichier ? 367 if (NextFile()) file->nextBlock(); 368 else break;373 if (NextFile()) file->nextBlock(); // fichier suivant 374 else return false; // tout fini 369 375 } 370 376 } … … 383 389 384 390 bool TOIIter::canGetValue(int column) { 391 if (!initDone) Init(); 385 392 if (column < 0 || column >= infos.size()) return false; 386 393 TOIKind kind = infos[column].kind; … … 439 446 440 447 double TOIIter::getValue(int column) { 448 if (!initDone) Init(); 441 449 if (column < 0 || column >= infos.size()) return -1; 442 450 TOIKind kind = infos[column].kind; … … 503 511 504 512 bool TOIIter::newValue(int column) { 513 if (!initDone) Init(); 505 514 if (column < 0 || column >= infos.size()) return false; 506 515 TOIKind kind = infos[column].kind; … … 596 605 597 606 int TOIIter::getSampleIndex() { 607 if (!initDone) Init(); 598 608 if (file) { 599 609 return file->blockNum() * file->nEchBlock() + imes; … … 604 614 605 615 double TOIIter::getMJD() { 616 if (!initDone) Init(); 606 617 int sample = getSampleIndex(); 607 618 return tBlock0 + sample*perEch/86400.; … … 621 632 622 633 block_type_param* TOIIter::lastParam() { 634 if (!initDone) Init(); 623 635 if (file) return file->lastParam(); 624 636 else return rawIter->lastParam();
Note:
See TracChangeset
for help on using the changeset viewer.