Index: trunk/ArchTOIPipe/Kernel/toisegment.h
===================================================================
--- trunk/ArchTOIPipe/Kernel/toisegment.h	(revision 2135)
+++ 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);
