Index: /trunk/ArchTOIPipe/Kernel/toi.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toi.cc	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toi.cc	(revision 2454)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toi.cc,v 1.12 2002-09-09 15:33:14 aubourg Exp $
+// $Id: toi.cc,v 1.13 2003-11-14 12:34:55 aubourg Exp $
 
 #include "toiprocessor.h"
@@ -68,9 +68,9 @@
 }
 
-int TOI::getMinSn(){
+long TOI::getMinSn(){
   return producer->getMinOut();
 }
 
-int TOI::getMaxSn(){
+long TOI::getMaxSn(){
   return producer->getMaxOut();
 }
@@ -97,9 +97,9 @@
  RZCMV   ----- l'interface va etre modifiee, NE PAS UTILISER
 #ifndef NO_SOPHYA 
-Array TOI::getError(int iStart, int iEnd) {
+Array TOI::getError(long iStart, long iEnd) {
   if (errorTOI == NULL) throw NotFoundExc("TOI::getDataError : no Error TOI");
   return errorTOI->getData(iStart, iEnd); 
 }
-Array TOI::getData(int iStart, int iEnd) {
+Array TOI::getData(long iStart, long iEnd) {
   lock();
   Array a = doGetData(iStart, iEnd);
@@ -108,5 +108,5 @@
   return a;
 }
-TArray<int_4> TOI::getFlag(int iStart, int iEnd) {
+TArray<int_4> TOI::getFlag(long iStart, long iEnd) {
   lock();
   TArray<int_4> a = doGetFlag(iStart, iEnd);
@@ -122,10 +122,10 @@
 /* 
 RZCMV  -------   A revoir les getError() ...
-double TOI::getError(int i) {
+double TOI::getError(long i) {
   if (errorTOI == NULL) throw NotFoundExc("TOI::getDataError : no Error TOI");
   return errorTOI->getData(i);
 }
 
-void TOI::putDataError(int i, double value, double error, int_4 flag) {
+void TOI::putDataError(long i, double value, double error, int_4 flag) {
   if (errorTOI == NULL) throw NotFoundExc("TOI::getDataError : no Error TOI");
   putData(i, value, flag);
@@ -135,5 +135,5 @@
 */
 
-double TOI::getData(int i) { /* deprecated, overriden in toisegment */
+double TOI::getData(long i) { /* deprecated, overriden in toisegment */
   lock();
   uint_8 flg;
@@ -145,5 +145,5 @@
 }
 
-void TOI::getData(int i, double &data, uint_8 &flag) { /* deprecated, overriden in toisegment */
+void TOI::getData(long i, double &data, uint_8 &flag) { /* deprecated, overriden in toisegment */
   lock();
   doGetData(i, data, flag);
@@ -153,15 +153,15 @@
 }
 
-void TOI::getData(int i, int n, double* data, uint_8* flg) {
+void TOI::getData(long i, int n, double* data, uint_8* flg) {
   cerr << "TOI::getData [double*] unimplemented" << endl;
   exit(-1);
 }
 
-void TOI::putData(int i, int n, double const* var, uint_8 const* flg) {
+void TOI::putData(long i, int n, double const* var, uint_8 const* flg) {
   cerr << "TOI::putData [double*] unimplemented" << endl;
   exit(-1);
 }
 
-void TOI::putData(int i, double value, uint_8 flag) { /* deprecated, overriden in toisegment */
+void TOI::putData(long i, double value, uint_8 flag) { /* deprecated, overriden in toisegment */
   lock();
   doPutData(i, value, flag);
@@ -170,5 +170,5 @@
 }
 
-void TOI::waitForData(int iStart, int iEnd) { /* deprecated, overriden in toisegment */
+void TOI::waitForData(long iStart, long iEnd) { /* deprecated, overriden in toisegment */
   if (producer == NULL) throw NotFoundExc("TOI has no producer !");
     
@@ -189,5 +189,5 @@
 }
 
-void TOI::waitForData(int i) { /* deprecated, overriden in toisegment */
+void TOI::waitForData(long i) { /* deprecated, overriden in toisegment */
   waitForData(i,i);
 }
@@ -201,5 +201,5 @@
 }
 
-TOI::DataStatus TOI::isDataAvail(int i) {
+TOI::DataStatus TOI::isDataAvail(long i) {
   lock();
   DataStatus stat = isDataAvailNL(i);
@@ -208,5 +208,5 @@
 }
 
-TOI::DataStatus TOI::isDataAvail(int i, int j) {
+TOI::DataStatus TOI::isDataAvail(long i, long j) {
   lock();
   DataStatus stat = isDataAvailNL(i,j);
@@ -215,10 +215,10 @@
 }
 
-TOI::DataStatus TOI::isDataAvailNL(int i) {
+TOI::DataStatus TOI::isDataAvailNL(long i) {
   return isDataAvailNL(i,i);
 }
 
-void TOI::wontNeedBefore(int i) { /* deprecated, overriden in toisegment */
-  int j=i;
+void TOI::wontNeedBefore(long i) { /* deprecated, overriden in toisegment */
+  long j=i;
   for (vector<TOIProcessor*>::iterator k = consumers.begin();
        k != consumers.end(); k++) {
@@ -230,19 +230,19 @@
 }
 
-void TOI::doWontNeedBefore(int i) {
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+void TOI::doWontNeedBefore(long i) {
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/ArchTOIPipe/Kernel/toi.h
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toi.h	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toi.h	(revision 2454)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toi.h,v 1.17 2002-09-09 15:33:15 aubourg Exp $
+// $Id: toi.h,v 1.18 2003-11-14 12:34:55 aubourg Exp $
 
 #ifndef TOI_H
@@ -49,24 +49,24 @@
   enum DataStatus       {DATA_OK=0, DATA_DELETED, DATA_NOT_YET};
     
-  virtual double        getData(int i);
-  virtual void          getData(int i, double &data, uint_8 &flag);
-  //RZCMV  virtual DataStatus    getDataError(int i,double &data,double &error,int_4 &flag);
-  virtual void          getData(int i, int n, double* data, uint_8* flg=0);
+  virtual double        getData(long i);
+  virtual void          getData(long i, double &data, uint_8 &flag);
+  //RZCMV  virtual DataStatus    getDataError(long i,double &data,double &error,int_4 &flag);
+  virtual void          getData(long i, int n, double* data, uint_8* flg=0);
 
-  virtual DataStatus    isDataAvail(int iStart, int iEnd);
-  virtual DataStatus    isDataAvail(int i);
-  virtual void          waitForData(int iStart, int iEnd);
-  virtual void          waitForData(int i);
+  virtual DataStatus    isDataAvail(long iStart, long iEnd);
+  virtual DataStatus    isDataAvail(long i);
+  virtual void          waitForData(long iStart, long iEnd);
+  virtual void          waitForData(long i);
   virtual void          waitForAnyData();
-  virtual int           nextDataAvail(int iAfter)=0;
+  virtual long           nextDataAvail(long iAfter)=0;
   virtual bool          hasSomeData()=0;
   
-  virtual void          putData(int i, double value, uint_8 flag=0);
-  //RZCMV  virtual void          putDataError(int i, double value, 
+  virtual void          putData(long i, double value, uint_8 flag=0);
+  //RZCMV  virtual void          putDataError(long i, double value, 
   //		                     double error, int_4 flag=0);
-  virtual void          putData(int i, int n, double const* val, uint_8 const* flg);
+  virtual void          putData(long i, int n, double const* val, uint_8 const* flg);
   virtual void          putDone() {}
 
-  virtual void          wontNeedBefore(int i);
+  virtual void          wontNeedBefore(long i);
   
   bool  dbg;
@@ -99,15 +99,15 @@
 #ifdef WITH_SOPHYA
   /* l'interface va etre modifiee, NE PAS UTILISER
-  virtual Array         doGetData(int iStart, int iEnd)=0;
-  virtual TArray<int_4> doGetFlag(int iStart, int iEnd)=0;
+  virtual Array         doGetData(long iStart, long iEnd)=0;
+  virtual TArray<int_4> doGetFlag(long iStart, long iEnd)=0;
   l'interface va etre modifiee, NE PAS UTILISER */
 #endif
 
-  virtual void          doGetData(int i, double& data, uint_8& flag)=0;
-  virtual void          doPutData(int i, double value, uint_8 flag=0)=0;
-  virtual void          doWontNeedBefore(int i);
+  virtual void          doGetData(long i, double& data, uint_8& flag)=0;
+  virtual void          doPutData(long i, double value, uint_8 flag=0)=0;
+  virtual void          doWontNeedBefore(long i);
 
-  virtual DataStatus    isDataAvailNL(int iStart, int iEnd)=0;
-  virtual DataStatus    isDataAvailNL(int i);
+  virtual DataStatus    isDataAvailNL(long iStart, long iEnd)=0;
+  virtual DataStatus    isDataAvailNL(long i);
 
   virtual void          setProducer(TOIProcessor* prod);
@@ -119,6 +119,6 @@
   string name;
 
-  virtual int           getMinSn();
-  virtual int           getMaxSn();
+  virtual long           getMinSn();
+  virtual long           getMaxSn();
   void  TOIInit();
 
Index: /trunk/ArchTOIPipe/Kernel/toisegment.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toisegment.cc	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toisegment.cc	(revision 2454)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toisegment.cc,v 1.28 2002-11-28 15:49:21 aubourg Exp $
+// $Id: toisegment.cc,v 1.29 2003-11-14 12:34:55 aubourg Exp $
 
 #include "toisegment.h"
@@ -58,22 +58,22 @@
 
 
-double TOISegmented::getData(int i) { /* reader thread */
+double TOISegmented::getData(long i) { /* reader thread */
   return master->getData(i);
 }
 
-void TOISegmented::getData(int i, double& data, uint_8& flag) { /* reader thread */
+void TOISegmented::getData(long i, double& data, uint_8& flag) { /* reader thread */
   data = master->getData(i);
   flag = master->getFlag(i);
 }
 
-void TOISegmented::getData(int i, int n, double* data, uint_8* flg) { /* reader thread */
+void TOISegmented::getData(long i, int n, double* data, uint_8* flg) { /* reader thread */
   master->getData(i, n, data, flg);
 }
 
-void TOISegmented::putData(int i, double value, uint_8 flag) { /* writer thread */
+void TOISegmented::putData(long i, double value, uint_8 flag) { /* writer thread */
   master->putData(i, value, flag);
 }
 
-void TOISegmented::putData(int i, int n, double const* val, uint_8 const* flg) { /* writer thread */
+void TOISegmented::putData(long i, int n, double const* val, uint_8 const* flg) { /* writer thread */
   master->putData(i, n, val, flg);
 }
@@ -83,9 +83,9 @@
 }
 
-void TOISegmented::wontNeedBefore(int i) {  /* reader thread */
+void TOISegmented::wontNeedBefore(long i) {  /* reader thread */
   master->getView()->wontNeedBefore(i);
 }
 
-TOI::DataStatus TOISegmented::isDataAvail(int i, int j) {
+TOI::DataStatus TOISegmented::isDataAvail(long i, long j) {
   // return master->getView()->isDataAvail(i, j);
   cout << "TOISegmented::isDataAvail unimplemented" << endl;
@@ -93,21 +93,21 @@
 }
 
-TOI::DataStatus TOISegmented::isDataAvail(int i) {
+TOI::DataStatus TOISegmented::isDataAvail(long i) {
   return isDataAvail(i,i);
 }
 
-TOI::DataStatus TOISegmented::isDataAvailNL(int i, int j) {
+TOI::DataStatus TOISegmented::isDataAvailNL(long i, long j) {
   return isDataAvail(i,j);
 }
 
-TOI::DataStatus TOISegmented::isDataAvailNL(int i) {
+TOI::DataStatus TOISegmented::isDataAvailNL(long i) {
   return isDataAvail(i);
 }
 
-void TOISegmented::waitForData(int iStart, int iEnd) {
+void TOISegmented::waitForData(long iStart, long iEnd) {
   // get will wait...
 }
 
-void TOISegmented::waitForData(int i) {
+void TOISegmented::waitForData(long i) {
   // get will wait...
 }
@@ -118,5 +118,5 @@
 }
 
-int TOISegmented::nextDataAvail(int iAfter) {
+long TOISegmented::nextDataAvail(long iAfter) {
   cout << "TOISegmented::nextDataAvail" << endl;
   return iAfter+1;
@@ -128,10 +128,10 @@
 }
 
-void TOISegmented::doPutData(int i, double value, uint_8 flag) {
+void TOISegmented::doPutData(long i, double value, uint_8 flag) {
   cout << "TOISegmented::doPutData unimplemented" << endl;
   throw PError("TOISegmented::doPutData unimplemented");
 }
 
-void TOISegmented::doGetData(int i, double& value, uint_8& flag) {
+void TOISegmented::doGetData(long i, double& value, uint_8& flag) {
   cout << "TOISegmented::doGetData unimplemented" << endl;
   throw PError("TOISegmented::doGetData unimplemented");
@@ -167,5 +167,5 @@
 }
 
-void TOISegmented::BufferSegment::getData(int sn, int n, double* d, uint_8* f) {
+void TOISegmented::BufferSegment::getData(long sn, int n, double* d, uint_8* f) {
   checkCommitted();
   checkInRange(sn);
@@ -177,5 +177,5 @@
 }
 
-void TOISegmented::BufferSegment::putData(int sn, double d, uint_8 f) { 
+void TOISegmented::BufferSegment::putData(long sn, double d, uint_8 f) { 
   /* writer thread*/
   if (status == NEW) {
@@ -192,5 +192,5 @@
 }
 
-void TOISegmented::BufferSegment::putData(int sn, int n, double const* d, uint_8 const* f) {
+void TOISegmented::BufferSegment::putData(long sn, int n, double const* d, uint_8 const* f) {
   if (status == NEW) {
     status = WRITE;
@@ -252,21 +252,21 @@
 }
 
-double TOISegmented::BufferView::getData(int sn) { /* Single-thread, reader thread*/
+double TOISegmented::BufferView::getData(long sn) { /* Single-thread, reader thread*/
   ensure(sn);
-  int seg = (sn-sn0)/segmentSize;
+  long seg = (sn-sn0)/segmentSize;
   return segments[seg]->getData(sn);
 }
 
-uint_8 TOISegmented::BufferView::getFlag(int sn) { /* Single-thread, reader thread */
+uint_8 TOISegmented::BufferView::getFlag(long sn) { /* Single-thread, reader thread */
   ensure(sn);
-  int seg = (sn-sn0)/segmentSize;
+  long seg = (sn-sn0)/segmentSize;
   return segments[seg]->getFlag(sn);
 }
 
-void TOISegmented::BufferView::getData(int sn, int n, double* dat, uint_8* flg) { /* Single-thread, reader thread */
+void TOISegmented::BufferView::getData(long sn, int n, double* dat, uint_8* flg) { /* Single-thread, reader thread */
   ensure(sn);
   ensure(sn+n-1);
   
-  int  sn1  = sn;
+  long  sn1  = sn;
   int  nsam = n;
   double* pdat = dat;
@@ -274,9 +274,9 @@
 
   while (true) {
-    int seg = (sn1-sn0)/segmentSize;
+    long seg = (sn1-sn0)/segmentSize;
     BufferSegment* s = segments[seg];
-    int snmax = s->sn0 + s->bufferSize - 1;
-    int sn2 = snmax > (sn1+nsam-1) ? (sn1+nsam-1) : snmax;
-    int nget = sn2-sn1+1;
+    long snmax = s->sn0 + s->bufferSize - 1;
+    long sn2 = snmax > (sn1+nsam-1) ? (sn1+nsam-1) : snmax;
+    long nget = sn2-sn1+1;
     s->getData(sn1, nget, pdat, pflg);
     pdat += nget;
@@ -288,5 +288,5 @@
 }
 
-void  TOISegmented::BufferView::ensure(int sn) { /* Single-thread, reader thread */
+void  TOISegmented::BufferView::ensure(long sn) { /* Single-thread, reader thread */
   if (sn < sn0) {
     cout << "TOISegmented::BufferView::ensure : requested sample before first" << endl;
@@ -321,5 +321,5 @@
 }
 
-void TOISegmented::BufferView::wait(int sn) { /* reader thread, master read wait lock taken */
+void TOISegmented::BufferView::wait(long sn) { /* reader thread, master read wait lock taken */
   //pthread_mutex_lock(&(master->read_wait_mutex));
   waiting = true;
@@ -334,5 +334,5 @@
 
 
-void TOISegmented::BufferView::wontNeedBefore(int sn) { /* reader thread */
+void TOISegmented::BufferView::wontNeedBefore(long sn) { /* reader thread */
   if (sn > firstNeeded) {
     firstNeeded = sn;
@@ -383,5 +383,5 @@
 }
 
-void TOISegmented::MasterView::putData(int sn, double data, uint_8 flags) { /* writer thread */
+void TOISegmented::MasterView::putData(long sn, double data, uint_8 flags) { /* writer thread */
   if (sn0<0) {
     LOG(cout << "***MasterView::putData sn0<0 -> " << sn << endl);
@@ -398,5 +398,5 @@
 }
 
-void TOISegmented::MasterView::putData(int sn, int n, double const* data, uint_8 const* flags) { /* writer thread */
+void TOISegmented::MasterView::putData(long sn, int n, double const* data, uint_8 const* flags) { /* writer thread */
   if (sn0<0) {
     LOG(cout << "***MasterView::putData sn0<0 -> " << sn << endl);
@@ -405,14 +405,14 @@
   double const*  pdat = data;
   uint_8 const*  pflg = flags;
-  int     nsam  = n;
-  int     sn1   = sn;
+  long     nsam  = n;
+  long     sn1   = sn;
   while (true) {
     // maximum that current segment can take
-    int snmax = -1;
+    long snmax = -1;
     if (currentSegment != NULL) {
       snmax = currentSegment->sn0 + currentSegment->bufferSize-1;
     }
-    int sn2 = snmax > (sn1+nsam-1) ? (sn1+nsam-1) : snmax;
-    int nput = sn2-sn1+1;
+    long sn2 = snmax > (sn1+nsam-1) ? (sn1+nsam-1) : snmax;
+    long nput = sn2-sn1+1;
     if (snmax>0 && nput>0) {
       currentSegment->putData(sn1, nput, pdat, pflg);
@@ -428,13 +428,13 @@
 }
 
-double TOISegmented::MasterView::getData(int sn) { /* reader thread */
+double TOISegmented::MasterView::getData(long sn) { /* reader thread */
   return getView()->getData(sn); /* thread-specific */
 }
 
-uint_8 TOISegmented::MasterView::getFlag(int sn) { /* reader thread */
+uint_8 TOISegmented::MasterView::getFlag(long sn) { /* reader thread */
   return getView()->getFlag(sn);
 }
 
-void TOISegmented::MasterView::getData(int sn, int n, double* dat, uint_8* flg) { /* reader thread */
+void TOISegmented::MasterView::getData(long sn, int n, double* dat, uint_8* flg) { /* reader thread */
   getView()->getData(sn, n, dat, flg);
 }
@@ -513,6 +513,6 @@
 //  int oldBegin = bv->sn0;
 //  int oldEnd   = bv->sn0 + bv->segmentSize * bv->segments.size();
-  int oldBegin = sn0;
-  int oldEnd   = sn0 + bv->segmentSize * segments.size();
+  long oldBegin = sn0;
+  long oldEnd   = sn0 + bv->segmentSize * segments.size();
 
   for (vector<BufferSegment*>::iterator i = bv->segments.begin();
@@ -529,5 +529,5 @@
 
   if (nConsumers == allViews.size()) {
-    int firstNeeded = MAXINT;
+    long firstNeeded = MAXINT;
     for (set<BufferView*>::iterator i = allViews.begin();
 	 i != allViews.end(); i++) {
@@ -570,5 +570,5 @@
 
   bv->sn0 = -1;
-  int newEnd = -1;
+  long newEnd = -1;
   if (segments.size() > 0) {
     bv->sn0 = bv->segments[0]->sn0;
Index: /trunk/ArchTOIPipe/Kernel/toisegment.h
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toisegment.h	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toisegment.h	(revision 2454)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toisegment.h,v 1.20 2002-07-26 10:36:19 ansari Exp $
+// $Id: toisegment.h,v 1.21 2003-11-14 12:34:55 aubourg Exp $
 
 #ifndef TOISEGMENT_H
@@ -32,25 +32,25 @@
   ~TOISegmented();
 
-  virtual double        getData(int i);
-  virtual void          getData(int i, double& data,  uint_8& flag);
-  virtual void          getData(int i, int n, double* data, uint_8* flg=0);
-  virtual void          putData(int i, double  value, uint_8  flag=0);
-  virtual void          putData(int i, int n, double const* val, uint_8 const* flg=0);
-  virtual void          wontNeedBefore(int i);
+  virtual double        getData(long i);
+  virtual void          getData(long i, double& data,  uint_8& flag);
+  virtual void          getData(long i, int n, double* data, uint_8* flg=0);
+  virtual void          putData(long i, double  value, uint_8  flag=0);
+  virtual void          putData(long i, int n, double const* val, uint_8 const* flg=0);
+  virtual void          wontNeedBefore(long i);
   virtual void          putDone();
   virtual void          addConsumer(TOIProcessor*);
 
   // Methodes ignorees car on reimplemente les methodes de base
-  virtual DataStatus    isDataAvail(int iStart, int iEnd);
-  virtual DataStatus    isDataAvail(int i);
-  virtual DataStatus isDataAvailNL(int i);
-  virtual DataStatus    isDataAvailNL(int iStart, int iEnd); // abstract
-  virtual void          waitForData(int iStart, int iEnd);
-  virtual void          waitForData(int i);
+  virtual DataStatus    isDataAvail(long iStart, long iEnd);
+  virtual DataStatus    isDataAvail(long i);
+  virtual DataStatus isDataAvailNL(long i);
+  virtual DataStatus    isDataAvailNL(long iStart, long iEnd); // abstract
+  virtual void          waitForData(long iStart, long iEnd);
+  virtual void          waitForData(long i);
   virtual void          waitForAnyData();
-  virtual int           nextDataAvail(int iAfter); // abstract
+  virtual long           nextDataAvail(long iAfter); // abstract
   virtual bool          hasSomeData(); // abstract
-  virtual void          doGetData(int i, double& data, uint_8& flag); // abs
-  virtual void          doPutData(int i, double value, uint_8 flag=0); // abs
+  virtual void          doGetData(long i, double& data, uint_8& flag); // abs
+  virtual void          doPutData(long i, double value, uint_8 flag=0); // abs
 
   
@@ -76,11 +76,11 @@
     int  getRefCount();
     
-    void putData(int sn, double data, uint_8 flag);
-    void putData(int sn, int n, double const* data, uint_8 const* flag);
-    inline double getData(int sn);
-    inline uint_8 getFlag(int sn);
-    void getData(int sn, int n, double* data, uint_8* flag);
-
-    bool isPastEnd(int sn) {
+    void putData(long sn, double data, uint_8 flag);
+    void putData(long sn, int n, double const* data, uint_8 const* flag);
+    inline double getData(long sn);
+    inline uint_8 getFlag(long sn);
+    void getData(long sn, int n, double* data, uint_8* flag);
+
+    bool isPastEnd(long sn) {
       return sn >= sn0+bufferSize;
     }
@@ -94,5 +94,5 @@
     }
 
-    void checkInRange(int sn) {
+    void checkInRange(long sn) {
       if (sn < sn0 || sn >= sn0+bufferSize) {
 	cerr << "TOISegment: out of range access in buffer segment " << sn << " not in " 
@@ -105,5 +105,5 @@
     int status;      // NEW, WRITE, COMMITTED
     int bufferSize;  
-    int sn0;         // Samplenum du premier echantillon
+    long sn0;         // Samplenum du premier echantillon
 
     int refcount;    // Nombre de vues qui utilisent 
@@ -123,9 +123,9 @@
     ~MasterView();
 
-    void putData(int sn, double data, uint_8 flag);
-    double getData(int sn);
-    uint_8 getFlag(int sn);
-    void   getData(int i, int n, double* data, uint_8* flg);
-    void   putData(int i, int n, double const* val, uint_8 const* flg);
+    void putData(long sn, double data, uint_8 flag);
+    double getData(long sn);
+    uint_8 getFlag(long sn);
+    void   getData(long i, int n, double* data, uint_8* flg);
+    void   putData(long i, int n, double const* val, uint_8 const* flg);
     BufferView* getView(); // thread-specific
     void putDone();
@@ -147,5 +147,5 @@
     int maxSegments;
     int segmentSize;
-    int sn0;                         // First sn in first segment
+    long sn0;                         // First sn in first segment
     vector<BufferSegment*> segments; // Committed segments
     int nConsumers;
@@ -174,24 +174,24 @@
     ~BufferView();
 
-    double getData(int sn);
-    uint_8 getFlag(int sn);    
-    void   getData(int i, int n, double* data, uint_8* flg);
-
-    void wontNeedBefore(int sn);
+    double getData(long sn);
+    uint_8 getFlag(long sn);    
+    void   getData(long i, int n, double* data, uint_8* flg);
+
+    void wontNeedBefore(long sn);
     
   protected:
-    void wait(int sn);  // Passe en attente d'un nouveau segment -- lecture
+    void wait(long sn);  // Passe en attente d'un nouveau segment -- lecture
     void sync();  // recupere les nouveaux segments, resync avec master
-    void ensure(int sn);
+    void ensure(long sn);
 
     bool waiting;
-    int  waitingFor;
+    long  waitingFor;
 
     friend class MasterView;
     MasterView* master;
     vector<BufferSegment*> segments; // Committed
-    int sn0; 
+    long sn0; 
     int segmentSize;
-    int firstNeeded;
+    long firstNeeded;
   };  
 
@@ -204,5 +204,5 @@
 /***********************************/
 
-double TOISegmented::BufferSegment::getData(int sn) {
+double TOISegmented::BufferSegment::getData(long sn) {
   checkCommitted();
   checkInRange(sn);
@@ -210,5 +210,5 @@
 }
 
-uint_8 TOISegmented::BufferSegment::getFlag(int sn) {
+uint_8 TOISegmented::BufferSegment::getFlag(long sn) {
   checkCommitted();
   checkInRange(sn);
Index: /trunk/ArchTOIPipe/Kernel/toiseqbuff.cc
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toiseqbuff.cc	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toiseqbuff.cc	(revision 2454)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toiseqbuff.cc,v 1.15 2002-05-30 10:09:06 ansari Exp $
+// $Id: toiseqbuff.cc,v 1.16 2003-11-14 12:34:55 aubourg Exp $
 
 #include "toiprocessor.h"
@@ -74,5 +74,5 @@
 }
 
-TOI::DataStatus TOISeqBuffered::isDataAvailNL(int iStart, int iEnd) {
+TOI::DataStatus TOISeqBuffered::isDataAvailNL(long iStart, long iEnd) {
   if (iEnd < iStart) 
     throw RangeCheckError("TOISeqBuffered::isDataAvailNL : iEnd<iStart !");
@@ -83,9 +83,9 @@
 }
 
-TOI::DataStatus TOISeqBuffered::isDataAvailNL(int i) {
+TOI::DataStatus TOISeqBuffered::isDataAvailNL(long i) {
   return TOI::isDataAvailNL(i);
 }
 
-void TOISeqBuffered::wontNeedBefore(int i) {
+void TOISeqBuffered::wontNeedBefore(long i) {
   // $CHECK$  Reza 30/4/2001 - Je ne sais pas a quoi ca sert !
   //  next_out = i; $CHECK$  Reza 30/4/2001
@@ -95,5 +95,5 @@
 #ifndef NO_SOPHYA
 /* ---- l'interface va etre modifiee, NE PAS UTILISER
-Array TOISeqBuffered::doGetData(int iStart, int iEnd) {
+Array TOISeqBuffered::doGetData(long iStart, long iEnd) {
   //  if (iEnd < iStart) 
   //    throw RangeCheckError("TOI::getData : iEnd<iStart !");
@@ -104,5 +104,5 @@
   cleanWaitGet();
   Vector dat(iEnd - iStart + 1);
-  for (int i=0; i<iEnd-iStart+1; i++) {
+  for (long i=0; i<iEnd-iStart+1; i++) {
     dat(i) = dataRef(i+iStart);
   }
@@ -115,5 +115,5 @@
 #endif
 
-double TOISeqBuffered::getData(int i)
+double TOISeqBuffered::getData(long i)
 {
   double val; 
@@ -124,5 +124,5 @@
 
 
-void TOISeqBuffered::getData(int i, double & val, uint_8 & flg) {
+void TOISeqBuffered::getData(long i, double & val, uint_8 & flg) {
   lock();
   if (!started) { 
@@ -168,5 +168,5 @@
 
 
-void TOISeqBuffered::getData(int i, int n, double* data, uint_8* flg)
+void TOISeqBuffered::getData(long i, int n, double* data, uint_8* flg)
 {
   lock();
@@ -184,5 +184,5 @@
     throw RangeCheckError("TOISeqBuffered::getData(i) : data deleted");
   }
-  for(int j=i; j<i+n; j++) {
+  for(long j=i; j<i+n; j++) {
     while (j >= next_in) { 
       if (j>next_out) next_out = j; 
@@ -218,5 +218,5 @@
 #ifndef NO_SOPHYA
 /* ---- l'interface va etre modifiee, NE PAS UTILISER
-TArray<int_4> TOISeqBuffered::doGetFlag(int iStart, int iEnd) {
+TArray<int_4> TOISeqBuffered::doGetFlag(long iStart, long iEnd) {
   if (!started) waitGet(); 
   cleanWaitGet();
@@ -224,5 +224,5 @@
     throw RangeCheckError("TOISeqBuffered::getFlag(iS,iE) : data not available");
   TVector<int_4> dat(iEnd - iStart + 1);
-  for (int i=0; i<iEnd-iStart+1; i++) {
+  for (long i=0; i<iEnd-iStart+1; i++) {
     dat[i] = flagRef(i+iStart);
   }
@@ -233,5 +233,5 @@
 
 /*RZCMV
-int_4 TOISeqBuffered::doGetFlag(int i) {
+int_4 TOISeqBuffered::doGetFlag(long i) {
   if (!started) waitGet(); 
   cleanWaitGet();
@@ -245,5 +245,5 @@
 
 
-void TOISeqBuffered::putData(int i, double value, uint_8 flag) {
+void TOISeqBuffered::putData(long i, double value, uint_8 flag) {
   lock();
   if (!started) {
@@ -290,5 +290,5 @@
 }
 
-void TOISeqBuffered::putData(int i, int n, double const* val, uint_8 const* flg) 
+void TOISeqBuffered::putData(long i, int n, double const* val, uint_8 const* flg) 
 {
   lock();
@@ -309,5 +309,5 @@
     }
   }
-  for(int j=i; j<i+n; j++) {
+  for(long j=i; j<i+n; j++) {
     if (next_in-next_out >= wsize) { 
       if (dbglev > 0) 
@@ -357,5 +357,5 @@
 }
 
-int TOISeqBuffered::nextDataAvail(int iAfter) {
+long TOISeqBuffered::nextDataAvail(long iAfter) {
   lock();
   if (iAfter >= next_in ) {unlock(); return -1;}
@@ -365,5 +365,5 @@
 }
 
-void TOISeqBuffered::doGetData(int i, double & val, uint_8 & flg)
+void TOISeqBuffered::doGetData(long i, double & val, uint_8 & flg)
 {
   cerr << " TOISeqBuffered::doGetData() not implemented !"
@@ -372,5 +372,5 @@
 }
 
-void TOISeqBuffered::doPutData(int i, double value, uint_8 flag)
+void TOISeqBuffered::doPutData(long i, double value, uint_8 flag)
 {
   cerr << " TOISeqBuffered::doGetData() not implemented !"
Index: /trunk/ArchTOIPipe/Kernel/toiseqbuff.h
===================================================================
--- /trunk/ArchTOIPipe/Kernel/toiseqbuff.h	(revision 2453)
+++ /trunk/ArchTOIPipe/Kernel/toiseqbuff.h	(revision 2454)
@@ -5,5 +5,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: toiseqbuff.h,v 1.10 2002-05-07 16:38:03 ansari Exp $
+// $Id: toiseqbuff.h,v 1.11 2003-11-14 12:34:56 aubourg Exp $
 
 #ifndef TOISEQBUFF_H
@@ -33,19 +33,19 @@
   inline int  getDebugLevel() const { return dbglev; }
 
-  virtual double        getData(int i);
-  virtual void          getData(int i, double& data,  uint_8& flag);
-  virtual void          getData(int i, int n, double* data, uint_8* flg=0);
-  virtual void          putData(int i, double  value, uint_8  flag=0);
-  virtual void          putData(int i, int n, double const* val, uint_8 const* flg=0);
-  virtual void          wontNeedBefore(int i);
+  virtual double        getData(long i);
+  virtual void          getData(long i, double& data,  uint_8& flag);
+  virtual void          getData(long i, int n, double* data, uint_8* flg=0);
+  virtual void          putData(long i, double  value, uint_8  flag=0);
+  virtual void          putData(long i, int n, double const* val, uint_8 const* flg=0);
+  virtual void          wontNeedBefore(long i);
 
-  inline int getFirstIn() const { return first_in; }
-  inline int getFirstOut() const { return first_out; }
-  inline int getLastIn() const { return (next_in-1); }
-  inline int getLastOut() const { return (next_out-1); }
+  inline long getFirstIn() const { return first_in; }
+  inline long getFirstOut() const { return first_out; }
+  inline long getLastIn() const { return (next_in-1); }
+  inline long getLastOut() const { return (next_out-1); }
 
 
-  virtual DataStatus isDataAvailNL(int iStart, int iEnd);
-  virtual DataStatus isDataAvailNL(int i); // override required
+  virtual DataStatus isDataAvailNL(long iStart, long iEnd);
+  virtual DataStatus isDataAvailNL(long i); // override required
 
 protected:
@@ -54,8 +54,8 @@
   int wsize;
   int buffsize;
-  int next_in;
-  int next_out;
-  int first_in;
-  int first_out;
+  long next_in;
+  long next_out;
+  long first_in;
+  long first_out;
   bool started;
   double defaultValue;
@@ -66,19 +66,19 @@
 #ifdef WITH_SOPHYA
   /* ---- l'interface va etre modifiee, NE PAS UTILISER
-  virtual Array         doGetData(int iStart, int iEnd);
-  virtual TArray<int_4> doGetFlag(int iStart, int iEnd);
+  virtual Array         doGetData(long iStart, long iEnd);
+  virtual TArray<int_4> doGetFlag(long iStart, long iEnd);
   l'interface va etre modifiee, NE PAS UTILISER ---- */
 #endif
-  virtual void          doGetData(int i, double & val, uint_8 & flg);
+  virtual void          doGetData(long i, double & val, uint_8 & flg);
    
-  virtual void          doPutData(int i, double value, uint_8 flag=0);
-  //  virtual void          doWontNeedBefore(int i);  plus besoin ? - Reza Mai 2002
+  virtual void          doPutData(long i, double value, uint_8 flag=0);
+  //  virtual void          doWontNeedBefore(long i);  plus besoin ? - Reza Mai 2002
 
-  virtual int           nextDataAvail(int iAfter);
+  virtual long           nextDataAvail(long iAfter);
   virtual bool          hasSomeData();
 
-  inline double &       dataRef(int i) { return data[i%buffsize]; }
-  inline uint_8 &        flagRef(int i) { return flags[i%buffsize]; }
-  inline bool           isDataDeleted(int i) 
+  inline double &       dataRef(long i) { return data[i%buffsize]; }
+  inline uint_8 &        flagRef(long i) { return flags[i%buffsize]; }
+  inline bool           isDataDeleted(long i) 
     { return((i < next_in-buffsize-1) ? true : false); }
 };
