Changeset 393 in Sophya for trunk/Poubelle/archTOI.old/toiiter.cc


Ignore:
Timestamp:
Sep 1, 1999, 11:24:28 AM (26 years ago)
Author:
ansari
Message:

Deplacement init toiiter pour eviter 2 archeopsfiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Poubelle/archTOI.old/toiiter.cc

    r363 r393  
    4040 
    4141 auxGPS = NULL;
    42 
     42 
     43 initDone = false;
    4344}
    4445
     
    7778  auxGPS = x.auxGPS;
    7879  if (auxGPS) auxGPS = auxGPS->clone();
     80 
     81  initDone = x.initDone;
    7982}
    8083
     
    9396
    9497void TOIIter::Init() {
     98 if (initDone) return;
     99 initDone = true;
    95100 // On a soit un repertoire, soit une liste de fichiers....
    96101  if (directory == "") {
     
    315320
    316321bool TOIIter::Next() {
     322  if (!initDone) Init();
    317323  while (1) {
    318324    if (!NextSample()) return false; // end of files
     
    365371      while (file->sameBlockNumAhead()) {  // tant que meme numero de bloc, on lit
    366372        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
    369375        }
    370376      }
     
    383389 
    384390bool TOIIter::canGetValue(int column) {
     391  if (!initDone) Init();
    385392   if (column < 0 || column >= infos.size()) return false;
    386393   TOIKind kind = infos[column].kind;
     
    439446 
    440447double TOIIter::getValue(int column) {
     448  if (!initDone) Init();
    441449   if (column < 0 || column >= infos.size()) return -1;
    442450   TOIKind kind = infos[column].kind;
     
    503511 
    504512bool   TOIIter::newValue(int column) {
     513  if (!initDone) Init();
    505514   if (column < 0 || column >= infos.size()) return false;
    506515   TOIKind kind = infos[column].kind;
     
    596605 
    597606int TOIIter::getSampleIndex() {
     607  if (!initDone) Init();
    598608   if (file) {
    599609     return file->blockNum() * file->nEchBlock() + imes;
     
    604614
    605615double TOIIter::getMJD() {
     616  if (!initDone) Init();
    606617  int sample = getSampleIndex();
    607618  return tBlock0 + sample*perEch/86400.;
     
    621632
    622633block_type_param* TOIIter::lastParam() {
     634  if (!initDone) Init();
    623635  if (file) return file->lastParam();
    624636  else return rawIter->lastParam();
Note: See TracChangeset for help on using the changeset viewer.