Ignore:
Timestamp:
05/19/11 19:06:32 (13 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp

    r196 r198  
    5050         nbargs    = SuperClass::getInt(startpos + currsize); 
    5151         currsize += SuperClass::getRequestedSize(nbargs); 
    52  
     52          
    5353         for (long int i = 0; i < nbargs; i++) 
    5454         { 
    5555            CBufferData bufdata; 
    56             SuperClass::getBufferData(bufdata, currsize); 
     56            SuperClass::getBufferData(bufdata, startpos + currsize); 
    5757            currsize += (bufdata.size + DATA_HEADER_SIZE); 
    5858         } 
     
    6666         StdSize startpos = this-> p_read; 
    6767         StdSize currsize = this->getNextRequestSize(); 
     68         
    6869         this->movePRead(currsize); 
    6970         this->nbrequest--; 
     71         std::cout <<  this->nbrequest << std::endl; 
     72         
    7073         return (CLinearBuffer(SuperClass::getData(startpos), currsize)); 
    7174      } 
     
    111114      { 
    112115         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          
    113122         if (this-> p_read == this-> p_unused) 
    114123         { 
    115124            this-> p_unused = this-> p_write; 
    116125            this-> p_read   = 0; 
     126            return; 
    117127         } 
    118128         if (this-> p_read == this-> p_write) 
     129         { 
    119130            this->clear(); 
     131         } 
    120132      } 
    121133       
     
    209221      void CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end) 
    210222      { 
    211          StdSize position = data_begin, i = 0; 
     223         StdSize position = data_begin;         
    212224         while (position != data_end) 
    213225         { 
    214             i++; 
    215226            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); 
    218230            long int nbarg = SuperClass::getInt(position); 
    219231            position = SuperClass::getNextDataPosition(position); 
    220232            for (long int i = 0; i < nbarg; i++) 
    221233               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 !"); 
    222240         } 
    223241      } 
Note: See TracChangeset for help on using the changeset viewer.