- Timestamp:
- May 7, 2002, 6:38:03 PM (23 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toiseqbuff.cc
r1762 r1985 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toiseqbuff.cc,v 1. 9 2001-11-13 16:22:47 aubourgExp $5 // $Id: toiseqbuff.cc,v 1.10 2002-05-07 16:38:03 ansari Exp $ 6 6 7 7 #include "toiprocessor.h" … … 85 85 } 86 86 87 void TOISeqBuffered:: doWontNeedBefore(int i) {87 void TOISeqBuffered::wontNeedBefore(int i) { 88 88 // $CHECK$ Reza 30/4/2001 - Je ne sais pas a quoi ca sert ! 89 89 // next_out = i; $CHECK$ Reza 30/4/2001 … … 113 113 #endif 114 114 115 void TOISeqBuffered::doGetData(int i, double & val, uint_8 & flg) { 115 double TOISeqBuffered::getData(int i) 116 { 117 double val; 118 uint_8 flg; 119 getData(i, val, flg); 120 return(val); 121 } 122 123 124 void TOISeqBuffered::getData(int i, double & val, uint_8 & flg) { 116 125 if (!started) { 117 cout << " TOISeqBuffered:: doGetData() - waitGet() Waiting for start ... " << endl;126 cout << " TOISeqBuffered::getData() - waitGet() Waiting for start ... " << endl; 118 127 waitGet(); 119 128 } … … 121 130 if (isDataDeleted(i)) { 122 131 if (dbglev > 0) 123 cout << " TOISeqBuffered:: doGetData() - DataDeleted() name=" << getName()124 << " i=" << i << " next_in= " << next_in 125 << " next_out=" << next_out << endl; 126 throw RangeCheckError("TOISeqBuffered:: doGetData(i) : data deleted");132 cout << " TOISeqBuffered::getData() - DataDeleted() name=" << getName() 133 << " i=" << i << " next_in= " << next_in 134 << " next_out=" << next_out << endl; 135 throw RangeCheckError("TOISeqBuffered::getData(i) : data deleted"); 127 136 } 128 137 while (i >= next_in) { 129 138 if (i>next_out) next_out = i; 130 139 if (dbglev > 0) 131 cout << " TOISeqBuffered:: doGetData() - waitGet() name=" << getName()140 cout << " TOISeqBuffered::getData() - waitGet() name=" << getName() 132 141 << " i=" << i << " next_in= " << next_in 133 142 << " next_out=" << next_out << endl; … … 144 153 if (isPutWaiting() && (next_in-next_out < wsize/2 )) { 145 154 if (dbglev > 0) 146 cout << " TOISeqBuffered:: doGetData() - signalPut() name=" << getName()147 << " i=" << i << " next_in= " << next_in 148 << " next_out=" << next_out << endl; 149 signalPut(); 155 cout << " TOISeqBuffered::getData() - signalPut() name=" << getName() 156 << " i=" << i << " next_in= " << next_in 157 << " next_out=" << next_out << endl; 158 signalPut(); signal(); 150 159 } 151 160 return; 161 } 162 163 164 void TOISeqBuffered::getData(int i, int n, double* data, uint_8* flg) 165 { 166 if (!started) { 167 cout << " TOISeqBuffered::getData(i,n ...) - waitGet() Waiting for start ... " << endl; 168 waitGet(); 169 } 170 cleanWaitGet(); 171 if (isDataDeleted(i)) { 172 if (dbglev > 0) 173 cout << " TOISeqBuffered::getData(i,n ...) - DataDeleted() name=" << getName() 174 << " i=" << i << " next_in= " << next_in 175 << " next_out=" << next_out << endl; 176 throw RangeCheckError("TOISeqBuffered::getData(i) : data deleted"); 177 } 178 for(int j=i; i<i+n; j++) { 179 while (j >= next_in) { 180 if (j>next_out) next_out = j; 181 if (dbglev > 0) 182 cout << " TOISeqBuffered::getData(i,n ...) - waitGet() name=" << getName() 183 << " j=" << j << " next_in= " << next_in 184 << " next_out=" << next_out << endl; 185 waitGet(); 186 if (dbglev > 0) 187 cout << " ... Out of waitGet() j=" << j 188 << " next_in= " << next_in << " next_out=" << next_out << endl; 189 } 190 cleanWaitGet(); 191 data[j-i] = dataRef(j); 192 if (flg) flg[j-i] = flagRef(j); 193 if (first_out < 0) first_out = j; 194 if ((j+1) > next_out) next_out = j+1; 195 if (isPutWaiting() && (next_in-next_out < wsize/2 )) { 196 if (dbglev > 0) 197 cout << " TOISeqBuffered::getData(i,n ...) - signalPut() name=" << getName() 198 << " i=" << i << " next_in= " << next_in 199 << " next_out=" << next_out << endl; 200 signalPut(); signal(); 201 } 202 } 203 return; 204 152 205 } 153 206 … … 182 235 183 236 184 void TOISeqBuffered:: doPutData(int i, double value, uint_8 flag) {237 void TOISeqBuffered::putData(int i, double value, uint_8 flag) { 185 238 if (!started) { 186 239 first_in = next_in = i; … … 191 244 if (i != next_in) { 192 245 if (dbglev > 0) 193 cout << " TOISeqBuffered:: doPutData() - i!=next_in() name=" << getName()246 cout << " TOISeqBuffered::putData() - i!=next_in() name=" << getName() 194 247 << " i=" << i << " next_in= " << next_in 195 248 << " next_out=" << next_out << endl; 196 string msg = "TOISeqBuffered:: doPutData() : i!=next_in TOIname=" + getName();249 string msg = "TOISeqBuffered::putData() : i!=next_in TOIname=" + getName(); 197 250 throw RangeCheckError(msg); 198 251 } 199 252 if (next_in-next_out >= wsize) { 200 253 if (dbglev > 0) 201 cout << " TOISeqBuffered:: doPutData() - waitPut() " << getName()254 cout << " TOISeqBuffered::putData() - waitPut() " << getName() 202 255 << " i=" << i 203 256 << " next_in= " << next_in << " next_out=" << next_out << endl; … … 214 267 if (isGetWaiting() && (next_in-next_out > wsize/8)) { 215 268 if (dbglev > 0) 216 cout << " TOISeqBuffered::doPutData() - signalGet() name=" << getName() 217 << " i=" << i << " next_in= " << next_in 218 << " next_out=" << next_out << endl; 219 signalGet(); 269 cout << " TOISeqBuffered::putData() - signalGet() name=" << getName() 270 << " i=" << i << " next_in= " << next_in 271 << " next_out=" << next_out << endl; 272 signalGet(); signal(); 273 } 274 } 275 276 void TOISeqBuffered::putData(int i, int n, double const* val, uint_8 const* flg) { 277 if (!started) { 278 first_in = next_in = i; 279 next_out = next_in; 280 started = true; 281 } 282 else { 283 if (i != next_in) { 284 if (dbglev > 0) 285 cout << " TOISeqBuffered::putData(i,n ...) - i!=next_in() name=" << getName() 286 << " i=" << i << " next_in= " << next_in 287 << " next_out=" << next_out << endl; 288 string msg = "TOISeqBuffered::putData() : i!=next_in TOIname=" + getName(); 289 throw RangeCheckError(msg); 290 } 291 } 292 for(int j=i; j<i+n; j++) { 293 if (next_in-next_out >= wsize) { 294 if (dbglev > 0) 295 cout << " TOISeqBuffered::putData(i,n ...) - waitPut() " << getName() 296 << " j=" << j 297 << " next_in= " << next_in << " next_out=" << next_out << endl; 298 waitPut(); 299 if (dbglev > 0) 300 cout << " ... Out of waitPut() j=" << j 301 << " next_in= " << next_in << " next_out=" << next_out << endl; 302 } 303 cleanWaitPut(); 304 dataRef(j) = val[j-i]; 305 if (flg) flagRef(j) = flg[j-i]; 306 else flagRef(j) = 0; 307 next_in = j+1; 308 } 309 if (isGetWaiting() && (next_in-next_out > wsize/8)) { 310 if (dbglev > 0) 311 cout << " TOISeqBuffered::putData(i,n ...) - signalGet() name=" << getName() 312 << " i=" << i << " next_in= " << next_in 313 << " next_out=" << next_out << endl; 314 signalGet(); signal(); 220 315 } 221 316 } … … 236 331 } 237 332 238 239 333 void TOISeqBuffered::doGetData(int i, double & val, uint_8 & flg) 334 { 335 cerr << " TOISeqBuffered::doGetData() not implemented !" 336 << " \n A quoi ca set ??? Reza - Mai 2002 " << endl; 337 throw NotAvailableOperation("TOISeqBuffered::doGetData() not implemented !"); 338 } 339 340 void TOISeqBuffered::doPutData(int i, double value, uint_8 flag) 341 { 342 cerr << " TOISeqBuffered::doGetData() not implemented !" 343 << " \n A quoi ca set ??? Reza - Mai 2002 " << endl; 344 throw NotAvailableOperation("TOISeqBuffered::doGetData() not implemented !"); 345 } -
trunk/ArchTOIPipe/Kernel/toiseqbuff.h
r1762 r1985 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toiseqbuff.h,v 1. 9 2001-11-13 16:22:47 aubourgExp $7 // $Id: toiseqbuff.h,v 1.10 2002-05-07 16:38:03 ansari Exp $ 8 8 9 9 #ifndef TOISEQBUFF_H … … 32 32 inline void setDebugLevel(int lev=0) { dbglev=lev; } 33 33 inline int getDebugLevel() const { return dbglev; } 34 35 virtual double getData(int i); 36 virtual void getData(int i, double& data, uint_8& flag); 37 virtual void getData(int i, int n, double* data, uint_8* flg=0); 38 virtual void putData(int i, double value, uint_8 flag=0); 39 virtual void putData(int i, int n, double const* val, uint_8 const* flg=0); 40 virtual void wontNeedBefore(int i); 34 41 35 42 inline int getFirstIn() const { return first_in; } … … 66 73 67 74 virtual void doPutData(int i, double value, uint_8 flag=0); 68 virtual void doWontNeedBefore(int i);75 // virtual void doWontNeedBefore(int i); plus besoin ? - Reza Mai 2002 69 76 70 77 virtual int nextDataAvail(int iAfter); -
trunk/ArchTOIPipe/TestPipes/SMakefile
r1980 r1985 7 7 # defined 8 8 # Usage: make -f SMakefile name_of_program 9 # make -f SMakefile clean 9 10 # *** Warning: GNU make should be used *** 10 11 # ############################################################### 11 12 12 13 include ../SMakefile.h 13 include ${DPCBASEREP}/Include/Makefile.slb14 15 14 16 15 ifdef NOSHLIB … … 46 45 %:%.c 47 46 48 .PRECIOUS: $( EXE)% $(OBJ)%.o47 .PRECIOUS: $(AEXE)% $(OBJ)%.o 49 48 50 %:$(EXE)%51 echo $@ " done"52 49 53 $(EXE)%:$(OBJ)%.o 50 # --- Compilation and linking rules 51 %:$(AEXE)% 52 echo '---' $@ build '-->' $< 53 54 $(AEXE)%:$(OBJ)%.o 54 55 $(LINK.cc) -o $@ $< $(LIBS) 55 56 … … 57 58 $(COMPILE.cc) $(USERFLAGS) -o $@ $< 58 59 59 $(EXE)%:$(OBJ)%.cc 60 $(LINK.cc) $(USERFLAGS) -o $@ $< $(LIBS) 61 62 $(EXE)%:$(OBJ)%.c 60 %:%.c 63 61 $(LINK.c) $(USERFLAGS) -o $@ $< $(LIBS) 64 65 $(OBJ)%.o:%.c66 $(COMPILE.c) -c $(CFLAGS) $(USERFLAGS) -o $@ $<67 62 68 63 dump : 69 64 echo $(LIBS) 70 65 66 clean : 67 ../cleantstpipes.csh
Note:
See TracChangeset
for help on using the changeset viewer.