Changeset 198 for XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp
- Timestamp:
- 05/19/11 19:06:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp
r196 r198 50 50 nbargs = SuperClass::getInt(startpos + currsize); 51 51 currsize += SuperClass::getRequestedSize(nbargs); 52 52 53 53 for (long int i = 0; i < nbargs; i++) 54 54 { 55 55 CBufferData bufdata; 56 SuperClass::getBufferData(bufdata, currsize);56 SuperClass::getBufferData(bufdata, startpos + currsize); 57 57 currsize += (bufdata.size + DATA_HEADER_SIZE); 58 58 } … … 66 66 StdSize startpos = this-> p_read; 67 67 StdSize currsize = this->getNextRequestSize(); 68 68 69 this->movePRead(currsize); 69 70 this->nbrequest--; 71 std::cout << this->nbrequest << std::endl; 72 70 73 return (CLinearBuffer(SuperClass::getData(startpos), currsize)); 71 74 } … … 111 114 { 112 115 this-> p_read += data_size; 116 if ((this-> p_read == this-> p_unused) && 117 (this-> p_read == this-> p_write)) 118 { 119 this->clear(); 120 } 121 113 122 if (this-> p_read == this-> p_unused) 114 123 { 115 124 this-> p_unused = this-> p_write; 116 125 this-> p_read = 0; 126 return; 117 127 } 118 128 if (this-> p_read == this-> p_write) 129 { 119 130 this->clear(); 131 } 120 132 } 121 133 … … 209 221 void CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end) 210 222 { 211 StdSize position = data_begin , i = 0;223 StdSize position = data_begin; 212 224 while (position != data_end) 213 225 { 214 i++;215 226 this->nbrequest++; 216 position = SuperClass::getNextDataPosition(position); // manager id 217 position = SuperClass::getNextDataPosition(position); // method id 227 position = SuperClass::getNextDataPosition(position); // manager id 228 position = SuperClass::getNextDataPosition(position); // method id 229 SuperClass::updateBufferData(position); 218 230 long int nbarg = SuperClass::getInt(position); 219 231 position = SuperClass::getNextDataPosition(position); 220 232 for (long int i = 0; i < nbarg; i++) 221 233 position = SuperClass::getNextDataPosition(position); 234 235 if (position > data_end) 236 ERROR("CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)", 237 << "[ position courante" << position 238 << ", fin de traitement" << data_end << " ] " 239 << "Impossible de mettre à jour la liste des requêtes !"); 222 240 } 223 241 }
Note: See TracChangeset
for help on using the changeset viewer.