Changeset 1367 in Sophya


Ignore:
Timestamp:
Jan 3, 2001, 4:11:55 PM (25 years ago)
Author:
aubourg
Message:

bounds

Location:
trunk/ArchTOIPipe
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.cc

    r1365 r1367  
    7272
    7373int FITSTOIReader::calcMinOut() {
    74   return firstSn;
     74  TOIManager* mgr = TOIManager::getManager();
     75  int firstReq = mgr->getRequestedBegin();
     76  return firstSn > firstReq ? firstSn : firstReq;
    7577}
    7678
    7779int FITSTOIReader::calcMaxOut() {
    78   return firstSn + nrows - 1;
     80  TOIManager* mgr = TOIManager::getManager();
     81  int lastReq = mgr->getRequestedEnd();
     82  int lastSn  = firstSn + nrows - 1;
     83  return lastSn < lastReq ? lastSn : lastReq;
    7984}
    8085
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1365 r1367  
    110110
    111111int TOIProcessor::getInputTOIIndex(string toi) {
     112  chkinit();
    112113  map<string, int>::iterator i = inIx.find(toi);
    113114  if (i == inIx.end()) return -1;
     
    116117
    117118int TOIProcessor::getOutputTOIIndex(string toi) {
     119  chkinit();
    118120  map<string, int>::iterator i = outIx.find(toi);
    119121  if (i == outIx.end()) return -1;
     
    136138  toi->setProducer(this);
    137139  outTOIs[(*i).second] = toi;
     140}
     141
     142string TOIProcessor::getOutName(int i) {
     143  if (i > outIx.size()) throw RangeCheckError("TOIProcessor::getOutName "
     144                                             " out of bound");
     145  map<string, int>::iterator j = outIx.begin();
     146  while (i) {i--; j++;};
     147  return (*j).first;
     148}
     149
     150string TOIProcessor::getInName(int i) {
     151  if (i > inIx.size()) throw RangeCheckError("TOIProcessor::getInName "
     152                                             " out of bound");
     153  map<string, int>::iterator j = inIx.begin();
     154  while (i) {i--; j++;};
     155  return (*j).first;
    138156}
    139157
  • trunk/ArchTOIPipe/Kernel/toiprocessor.h

    r1365 r1367  
    9191  virtual void  addOutput(string name, TOI* toi);
    9292
     93
     94  int getNIn()  {chkinit(); return inIx.size();}
     95  int getNOut() {chkinit(); return outIx.size();}
     96  string getOutName(int i);
     97  string getInName(int i);
     98
    9399  virtual void  start();
    94100 
  • trunk/ArchTOIPipe/TestPipes/tsttoi2.cc

    r1365 r1367  
    1414
    1515 
    16   TOI* toi = new TOIRegularDeque("t1");
     16  TOI* toi = new TOIRegularWindow("t1");
    1717  //  toi->dbg=true;
    1818  r.addOutput("boloMuV_11", toi);
    1919  w.addInput("bolo_filtered", toi);
    2020 
    21   cout << "starting" << endl;
    22 
    2321  r.start();
    2422  w.start();
    2523
    26   cout << "joining" << endl;
    2724  mgr->joinAll();
    2825}
Note: See TracChangeset for help on using the changeset viewer.